This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; start heating up the bed and nozzle together | |
M140 S{material_bed_temperature_layer_0} ; Set bed temperature | |
M104 S{material_print_temperature_layer_0} T0 ; Set nozzle temp | |
G28 ; home all axes | |
M190 S{material_bed_temperature_layer_0} ; Set bed temperature and wait | |
M109 S{material_print_temperature_layer_0} T0 ; Set nozzle temp and wait | |
M117 Purge extruder | |
G92 E0 ; reset extruder | |
G1 Z5.0 F3000 ; move z up little to prevent scratching of surface | |
G1 X5 Y20 Z0.3 F5000.0 ; move to start-line position |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Tronxy Crux1 Start Code | |
; Forked from the Tronxy XY 2 Pro Start code on cura | |
; Improvement: Start nozzle and bed heating together | |
; Imorovement: Fixed purge line (XY2 version was for a bigger bed and would draw out of build area) | |
; Bugfix: On glass bed Crux 1, the nozzle would bump on the retainer trying to draw the purge line. Fixed in this version. | |
; Cleanup: Removed all ABL related code since Crux 1 does not have ABL. | |
G21 ; Set units to millimeters | |
G90 ; Set all axis to Absolute | |
M82 ; Set extrusion to Absolute | |
M107 ; Disable all fans |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created By Anam Ahmed (https://anam.co) | |
* Test the browser's capability to establish RTCPeerConnection with supplied RTC Configuration | |
* How to use: probeRTC(RTCParam,false, callback) // will call callback function with true or false. | |
* If you don't supply the callback function it will return a Promise. | |
* The promise will resolve (with total time required for the whole round trip ,in ms) or reject (with error) based on the result. | |
* Setting verbose = true will print logs in console | |
* @param {RTCConfiguration} rtcConfig | |
* @param {Boolean} verbose | |
* @param {Function} callback [optional] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const otpGenerator = require("otp-generator"); | |
const crypto = require("crypto"); | |
const key = "verysecretkey"; // Key for cryptograpy. Keep it secret | |
function createNewOTP(phone){ | |
// Generate a 6 digit numeric OTP | |
const otp = otpGenerator.generate(6, {alphabets: false, upperCase: false, specialChars: false}); | |
const ttl = 5 * 60 * 1000; //5 Minutes in miliseconds | |
const expires = Date.now() + ttl; //timestamp to 5 minutes in the future | |
const data = `${phone}.${otp}.${expires}`; // phone.otp.expiry_timestamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These imports and values are the same from the create source code. Perhaps you should keep them in the same file | |
// For the sake of demonstration, the imports are used here as well. | |
const crypto = require("crypto"); | |
const key = "verysecretkey"; // Key for cryptograpy. Keep it secret | |
function verifyOTP(phone,hash,otp){ | |
// Seperate Hash value and expires from the hash returned from the user | |
let [hashValue,expires] = hash.split("."); | |
// Check if expiry time has passed | |
let now = Date.now(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const otpGenerator = require("otp-generator"); | |
const crypto = require("crypto"); | |
const key = "verysecretkey"; // Key for cryptograpy. Keep it secret | |
function createNewOTP(phone){ | |
// Generate a 6 digit numeric OTP | |
const otp = otpGenerator.generate(6, {alphabets: false, upperCase: false, specialChars: false}); | |
const ttl = 5 * 60 * 1000; //5 Minutes in miliseconds | |
const expires = Date.now() + ttl; //timestamp to 5 minutes in the future | |
const data = `${phone}.${otp}.${expires}`; // phone.otp.expiry_timestamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
# Wordpress | |
mysite: | |
image: wordpress:5.2.3-php7.1-apache | |
volumes: | |
- ./themes:/var/www/html/wp-content/themes | |
- ./plugins:/var/www/html/wp-content/plugins | |
ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^(?:\+88|88)?(01[3-9]\d{8})$/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**** | |
Creatd by Anam Ahmed (https://anam.co) | |
Sample Use: | |
document.querySelector("input[type=file]").addEventListener("change",function(e){ | |
if(e.target.files.length){ | |
_resample(e.target.files[0],1000,function(response){ | |
console.log(response); // returns an object: {stats:<compression stats>,file:output file} | |
}); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const moment = require('moment'); | |
const colors = { | |
"green" :"\x1b[32m", | |
"yellow":"\x1b[33m%s\x1b[0m", | |
"red":"\x1b[31m", | |
"cyan":"\x1b[36m", | |
"blue":"\x1b[34m", | |
"default":"" | |
} | |
module.exports = function (message,color="default"){ |
NewerOlder