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
REGEX: Trim everything up to and including = | |
var text = "[email protected]"; | |
text = text.replace(/@.*$/,""); | |
console.log(text); | |
// results = "john" |
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
$ sudo ssh 192.168.2.2 -l pi | |
#The option “-l pi' specifies that we want to log into the Pi as the user “pi”. | |
# clear SSH connection issues with: $ perl -pi -e 's/\Q$_// if ($. == 5);' /var/root/.ssh/known_hosts |
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
$ git clone https://github.com/todbot/blink1.git | |
$ cd blink1/commandline | |
$ make |
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
$ npm init |
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
$ SET PATH=C:\Program Files\Nodejs;%PATH% |
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 fs = require('fs'); | |
var file = __dirname + '/data/filename.json'; | |
fs.readFile(file, 'utf8', function (err, data) { | |
if (err) { | |
console.log('Error: ' + err); | |
return; | |
} | |
obj_pulseconfig = JSON.parse(data); | |
console.dir(data); |
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 Parse = require('parse').Parse; | |
Parse.initialize("Your App Id", "Your JavaScript Key"); | |
var query = new Parse.Query(Parse.User); | |
query.find({ | |
success: function(users) { | |
for (var i = 0; i < users.length; ++i) { | |
console.log(users[i].get('username')); | |
} |
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 Query = Parse.Object.extend("parse_class"); | |
var query = new Parse.Query(Query); | |
//set query conditions | |
query.ascending("parse_item"); //sorts the results in ascending order by the score field | |
query.descending("score"); //sorts the results in descending order by the score field | |
query.limit(10); //limit to at most 10 results | |
query.skip(10); //skip the first 10 results | |
query.equalTo("playerEmail", "[email protected]"); | |
query.notEqualTo("playerName", "Michael Yabuti"); |
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
/* Usage | |
1. Run the setup function (you'll need to do this twice - 1st time to grant acces to Script Properties) | |
2. Share > Publish as service ... set security level and enable service | |
3. Copy the service URL and post this in your form/script action | |
4. Insert column names on the DATA sheet matching the parameter names of the data you are passing | |
*/ | |
function doGet(e) { // change to doPost(e) if you are recieving POST data | |
var ss = SpreadsheetApp.openById(ScriptProperties.getProperty('active')); | |
var sheet = ss.getSheetByName("DATA"); |