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
| /** | |
| * NOTE: Does not work with npm installed heroku-cli | |
| * | |
| * Heroku CLI REQUIRED! Uninstall with: npm uninstall heroku -g | |
| * Install Heroku with: curl https://cli-assets.heroku.com/install.sh | sh | |
| * Login Heroku with: heroku login | |
| * | |
| * after login you can run test | |
| * like: $ mocha test/bug/1243.js | |
| * |
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
| module.exports = function(gun) { | |
| function $gun(last) { | |
| var self = this; | |
| if (last) { | |
| self.last = last; | |
| self.root = last.root; | |
| } | |
| else { | |
| self.user = function(user) { | |
| var _user = new $gun(); |
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
| module.exports = function(pwd, extra) { | |
| var forge = require("node-forge"); | |
| forge.options.usePureJavaScript = true; | |
| var EC = require('elliptic').ec; | |
| return new Promise((resolve, reject) => { | |
| var ec_p256 = new EC('p256'); | |
| if (!pwd) |
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
| #ifdef USE_ECDH | |
| #include "mbedtls/include/mbedtls/ecdh.h" | |
| static NO_INLINE JsVar *jswrap_crypto_ecdh(JsVar *message, JsVar *key, JsVar *options, bool genSecret ) { | |
| int ret; | |
| JSV_GET_AS_CHAR_ARRAY(msgPtr, msgLen, message); | |
| if (!msgPtr) return 0; | |
| mbedtls_ecdh_context ecdh_ctx; |
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
| var net = require('net'); | |
| var fs = require('fs'); | |
| var SSH_AUTH_SOCK_PATH_PREFIX = "/tmp/ssh-agent." | |
| var SSH_AUTH_SOCK_PATH_POSTFIX = ".sock" | |
| function createServer(socketName, callback, onConnect) { | |
| var SSH_AUTH_SOCK_PATH = SSH_AUTH_SOCK_PATH_PREFIX + socketName + SSH_AUTH_SOCK_PATH_POSTFIX; |
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
| uint32_t baud; | |
| uint32_t old_baud; | |
| void loop() { | |
| // put your main code here, to run repeatedly: | |
| baud = Serial.baud(); | |
| if (baud != old_baud) { |
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
| /************************************* | |
| * Dual Channel DC Motor Driver Board* | |
| * Code Written by Idayu - MYBOTIC * | |
| *************************************/ | |
| int IN1 = 12; | |
| int IN2 = 11; | |
| int IN3 = 7; | |
| int IN4 = 6; |
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
| // N0 M106*36 | |
| // N1 G28*18 | |
| // N2 M107*39 | |
| getCS("N0 M106"); | |
| getCS("N1 G28"); | |
| getCS("N2 M107"); |
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
| export CLICOLOR=1 | |
| export LSCOLORS=GxFxCxDxBxegedabagaced | |
| #PS1="\h:\W \u\$" # Default | |
| PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " | |
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
| var key1Name = "test13"; | |
| var key2Name = "test22"; | |
| // "hex" or "base64", default is raw(Uint8Array) | |
| var encoding = "hex"; | |
| ////----------------------- | |
| var atob = require("atob"); | |
| var btoa = require("btoa"); |