No sync versions of functions. These may encapsulate high-latency remote filesystems. Including sync operations is inappropriate.
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 | |
kexec --load /boot/coreos_production_pxe.vmlinuz --initrd=/boot/coreos_production_pxe_image.cpio.gz --append='state=/dev/vda root=squashfs: sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQCZ3fvhC7StXFdFRuXApBuXyS2phoH7ZVKMUMOi3DrbnZWC01GUq74WdalRDHtfq2dl0CPctLb8RHSD+/dKgWEH0gmoEOCio09ZAY5Ui4Cy+0cCGefXkUnJR4lgNOYD076BXjJwsCVCD8sMlFFT08Qn4/voP0jpL1uvvoWiC1KSvSjZf7sP/hRgsO633OuclXyVVq7mC6q+2QVg6hfO49Gt7TVXb+8lc8aUHAYyrXEVag6oICWqxWlSglbEpXCXhK4RB1f8h2vCaEPe2Kf1LNPYJ3dN5H5v+tnst9oZbFjo/qNSm4RvPBb3nsNARdcemdGcwiTjAiIn9gMxBMOyiYOYSgVwGd2U76FR0/RUFUORprynn6uebBhtpGzIAuFsUygMAPAM2tocO+t+h8AQviF6IeA9rKwf5bFTXV9HLy+iUoCWsVBmGypfGbsD7UNg3DIpXv4FdoLDDiCq+OV16ludjLk5pjknshH0cII+Q5b1fcITKSMrZ0CnMytkHHYPTvJ/uc2W9p3howAbMCs+WpNsSnLoCfq5ZjWclauV9Sn7OULQSMuKzTBF+bN7FOyolPbFrW+B3ESUpbonbLbKOubvsBjnUQLNoNjH4pa5Sg3Pluh1EoYLq/oKYU/C+SSwnbRy9N1h2z5UZy/CyrGNG8UomkuFIZWOAGH+zqwU1iCYaWHPgUNXM+4gSe0cGmVesFRpco5nhqvHGdDtw3OCC1U0f9jj6Pk+4jFmulj45+Hu4ZEL8wyMlftbycT8KtuqSVOD/yuytPFlvBzFrjP9s3V8ZN46y5rLpR9dAD+DJHYVESGxQV9lLq2g0p8IJ |
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 exec = require('child_process').exec; | |
function wew(cb){ | |
exec("iwlist wlan2 scan|grep -Po '(?<=Address: )\\S+|(?<=Signal level=)\\S+|(?<=ESSID:\")[^\"]+'", test(cb)); | |
} | |
function test(cb) { | |
return function (error, stdout, stderr) { | |
var out = stdout.replace(/^\s+/mg, ''); | |
out = out.split('\n'); |
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 dgram = require('dgram'); | |
var srp = require('srp'); | |
var util = require('util'); | |
var DBConn = require('./dbconn'); | |
var proto = require('./proto'); | |
// UDPApp | |
// | |
// This object encompasses all functionality dealing with the UDP endpoint of |
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'); | |
function writeTime(){ | |
var lifedata; | |
var filename = './life.json'; | |
fs.readFile(filename, 'utf8', function (err, data) { | |
if (err) throw err; | |
lifedata = JSON.parse(data); | |
doWrite(); | |
}); |
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
module.exports = function Class() {} | |
Class.prototype.method = function () { | |
SomethingInternal.call(this) | |
} | |
function SomethingInternal() { | |
console.log("I'm internal, and I'm currently a method of", this); | |
} |
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
<script src="http://localhost:3000/socket.io/socket.io.js"></script> | |
<script> | |
var news = io.connect('http://localhost:3000/').of('/news'); | |
news.emit("raul", new Array("1","2","3","4","5","6","7","8","9","10") ); | |
news.on('get_random_number_from_raul', function(data) { | |
console.log('random', 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
Friend.findOne({ | |
userId: req.signedCookies.userid | |
}, function (err, signedInUser) { | |
function doCheck(err, currentUser) { | |
if (err) { | |
res.send(err); | |
} else { | |
console.log('doCheck'); | |
//for(var x = 0; x < users.length; x++) { | |
//var currentUser = users[x]; |
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
module ApplicationHelper | |
def combine_highlight(selected_text, surrounding_text) | |
if surrounding_text.include? selected_text | |
split_text = surrounding_text.split(selected_text) | |
content_tag(:p, (split_text[0] || '').html_safe + content_tag(:span, selected_text, class:"selected") + (split_text[1] || '').html_safe) | |
else | |
content_tag(:p, surrounding_text, class:"selected") | |
end | |
end |
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
module ApplicationHelper | |
def combine_highlight(selected_text, surrounding_text) | |
if surrounding_text.include? selected_text | |
split_text_array = surrounding_text.split(selected_text) | |
if split_text_array[0].blank? | |
if split_text_array[1].blank? | |
content_tag(:p, content_tag(:span, selected_text, class:"selected")) | |
else |