Skip to content

Instantly share code, notes, and snippets.

View aredridel's full-sized avatar
💭
See my social media for status.

Aria Stewart aredridel

💭
See my social media for status.
View GitHub Profile
@aredridel
aredridel / file1.js
Last active August 29, 2015 13:56 — forked from anonymous/file1.js
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');
@aredridel
aredridel / client.html
Last active January 1, 2016 17:29 — forked from raulp/server.js
<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);
});
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];
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
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
@aredridel
aredridel / vagrant.org
Created November 9, 2012 17:23 — forked from akiatoji/vagrant.org
CentOS 6.2 Box for Vagrant

Installing CentOS

Download net install iso:

  • CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
var repl = require('repl')
, rl;
rl = repl.start({
prompt: '>>> '
, input: process.stdin
, output: process.stdout
});
rl.on('close', function () {