Skip to content

Instantly share code, notes, and snippets.

View etoxin's full-sized avatar

Adam Lusted etoxin

View GitHub Profile
@etoxin
etoxin / chatAppInATweet.js
Created February 3, 2016 02:37
Chat App in a tweet.
r=require,f='<form><input name=m>';r('http').createServer((q,s)=>s.end(f=('<p>'+(r('querystring').parse(q.url)['/?m']||'')+f))).listen(3000)
@etoxin
etoxin / randomString.js
Created January 20, 2016 07:01
Create a string that s random
/**
* @param lng {Number}
* @returns {string}
* @constructor
*/
function MakeId(lng) {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < lng; i++)
@etoxin
etoxin / app.js
Last active January 19, 2016 03:02
Javascript Module Loader
// All modules must have a init function.
/**
* ready Function
* @param fn
*/
function ready(fn) {
if (document.readyState != 'loading'){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
@etoxin
etoxin / collection.csv
Last active January 28, 2016 05:14
RDIO
Name Artist Album Track Number
! (The Song Formerly Known As) Regurgitator Jingles: The Best Of 3
You Got A Killer Scene There, Man... Queens Of The Stone Age Lullabies To Paralyze (International Version) 13
'82 Stone Sour House of Gold & Bones Part 2 7
(515) Slipknot The Studio Album Collection 1999 - 2008 16
(Antichrist Television Blues) Arcade Fire Neon Bible 8
(Antichrist Television Blues) Arcade Fire Neon Bible (Comm CD) 8
(Baby I've Got You) On My Mind Powderfinger Footprints: The Best of Powderfinger 2001 - 2011 2
(Baby I've Got You) On My Mind Powderfinger Fingerprints & Footprints - The Ultimate Collection 19
(Exchange) Massive Attack Mezzanine 11
@etoxin
etoxin / encryption.sh
Last active October 20, 2015 10:45
How do I simply encrypt a file in terminal.
# encrypt file.txt to file.enc using 256-bit AES in CBC mode
openssl enc -aes-256-cbc -salt -in file.txt -out file.enc
# the same, only the output is base64 encoded for, e.g., e-mail
openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc
# decrypt binary file.enc
openssl enc -d -aes-256-cbc -in file.enc -out file.txt
# decrypt base64-encoded version
@etoxin
etoxin / example.js
Last active October 21, 2015 00:11
Access global var Browser + Node (Isomorphic)
(function (glob) {
// glob points to global object
}(typeof window !== 'undefined' ? window : global));
@etoxin
etoxin / PassByReferenceParameters.js
Created October 19, 2015 03:18
Pass By Reference Parameters
var globalVar1 = [5];
var globalVar2 = 5;
console.log('before: ' + globalVar1 + ', ' + globalVar2);
function myFunction(value1, value2){
value1[0]++;
value2++;
console.log('inside: ' + value1 + ', ' + value2);
}
myFunction(globalVar1, globalVar2);
@etoxin
etoxin / Top Entitlement Claiming Federal Politicians in Australia (2H 2014).txt
Last active November 23, 2015 23:03 — forked from dannolan/spendyspendy.txt
Top Entitlement Claiming Federal Politicians in Australia (2H 2014)
Top Spenders OVERALL
The Hon Tony Abbott MP - $1057673
The Hon Julie Bishop MP - $866653
Mr Tony Pasin MP - $851482
Mr Tim Watts MP - $556863
The Hon Andrew Robb AO MP - $539247
The Hon Darren Chester MP - $529344
Mr Wyatt Roy MP - $526258
Senator the Hon Simon Birmingham - $523191
@etoxin
etoxin / exampleThree.html
Last active May 9, 2016 23:41
Geolocation example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Boom!</title>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script>
var stuff = {
run: function () {