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
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
@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 / boot-coreos.sh
Last active January 4, 2016 18:12
Set up and boot CoreOS on top of a stock DigitalOcean Fedora 19 install. Abuses the Fedora 19 root as the CoreOS STATE partition. Still todo: copy SSH keys from Fedora install.
#!/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
@aredridel
aredridel / DataUrl.ometajs
Last active August 29, 2015 13:56
Parsing data URL with ometajs
ometa DataUrl {
scheme = "data:",
type = /[a-z-]+/,
charset = /[a-z-]+/,
mimeType = type "/" type ( ";charset=" charset )?,
charset =
@aredridel
aredridel / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am aredridel on github.
  • I am aredridel (https://keybase.io/aredridel) on keybase.
  • I have a public key whose fingerprint is 7181 12A2 A598 9A18 C5C6 733A 382C 45D1 EB10 1DAC

To claim this, I am signing this object:

@aredridel
aredridel / Async Code Katas I.md
Created March 17, 2014 05:09
Asynchronous Code Katas for Javascript

Asynchronous Javascript Code Katas

Part 1: Simple values, sequential flow

Write a synchronous get function and set function. Get a value, set a value, get again.

function makeThing() {
	var val = 0;
	return {
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.util.store.DataStoreFactory;
import com.google.api.client.util.store.FileDataStoreFactory;
import com.google.api.services.androidpublisher.AndroidPublisher.Builder;
var fs = require('fs');
var http = require('http');
var png = fs.readFileSync('x.png.txt', 'utf8');
http.createServer(function (req, res) {
res.setHeader('Content-Type', 'image/png');
res.end(new Buffer(png, 'base64'));
}).listen(8080);
@aredridel
aredridel / index.js
Last active August 29, 2015 14:11
Refactoring to continuation-passing
var http = require('http');
var bl = require('bl');
function start(callback) {
option = {};
options.path = '/start';
var req = http.request(options, function (res) { res.pipe(bl(callback)) });
req.end();
}
4-6 servings.
3.5 oz dried rice noodles, cooked; or use spaghetti
2 carrots, grated
1/2 medium napa cabbage, shredded finely (regular cabbage works too)
5 cloves of garlic, minced
1 tablespoon fresh ginger, grated
3 green onions, sliced
1/2 to 1 teaspoon sesame oil
1 to 2 tablespoons brown sugar