- Download firmware (70.03.0A) to the internal smartphone memory or SD card;
- Install nRF Toolbox for BLE from Google Play;
- Open nRF Toolbox → go to DFU section;
- Select firmware file → chose "application" type with "no init packet";
- Select device for firmware upload (named "DfuMode");
- Tap "Start".
This file contains 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
// for detailed comments and demo, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381 | |
/* a helper to execute an IF statement with any expression | |
USAGE: | |
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes | |
-- to access any global function or property you should use window.functionName() instead of just functionName() | |
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later | |
<p> | |
{{#xif " name == 'Sam' && age === '12' " }} | |
BOOM |
This file contains 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
(function () { | |
// By joseph khoury | |
let context = new AudioContext(); | |
let sound = context.createOscillator(); | |
sound.type = "sine"; | |
sound.connect(context.destination); | |
sound.frequency.value = 200; | |
sound.start(); | |
let ison = true; |
This file contains 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
/* | |
// from bootstrap/scss/_variables.scss | |
$grid-breakpoints: ( | |
xs: 0, | |
sm: 576px, | |
md: 768px, | |
lg: 992px, | |
xl: 1200px | |
) !default; |
This file contains 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
// you must install the 3 modules for this to work | |
// npm install bluebird q when | |
// so the gist here, no pun intended, is that when you're testing for a Promise, it's totally fine | |
// to either check if the object is instanceof Promise or even if Promise.resolve(object) == object | |
// UNLESS there is a chance that this promise is returned from a third party promise library, or even | |
// if you have plugins or some other modules using your module, | |
// ... so, if you don't know which "Promise" constructor could be getting, |
This file contains 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 asyncHook = require('async-hook'); | |
var path = require('path'); | |
var utils = require('../../public/src/utils'); | |
function CLS() { | |
var mem = {}; | |
var self = this; | |
this.storage = null; |
This file contains 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
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.20-macos10.12-x86_64.tar.gz | |
tar xfvz mysql-5.7* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
This file contains 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
// tested with NodeBB v1.4.6+ | |
var path = require('path'); | |
var url = require('url'); | |
var nconf = require('nconf'); | |
var async = require('async'); | |
var pkg = require('./package.json'); | |
nconf.file({ file: path.join(__dirname, './config.json') }); |
This file contains 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
// tested with NodeBB v1.4.6+ | |
var path = require('path'); | |
var nconf = require('nconf'); | |
var async = require('async'); | |
var pkg = require('./package.json'); | |
nconf.file({ file: path.join(__dirname, './config.json') }); |
This file contains 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 path = require('path'); | |
var nconf = require('nconf'); | |
var async = require('async'); | |
var url = require('url'); | |
var _convert = require('./node_modules/nodebb-plugin-import/node_modules/bbcode-to-markdown'); | |
nconf.file({ file: path.join(__dirname, './config.json') }); | |
var dbType = nconf.get('database'); |
NewerOlder