Skip to content

Instantly share code, notes, and snippets.

View ozten's full-sized avatar

Austin King ozten

View GitHub Profile
@ozten
ozten / multi-dimensional.js
Created November 11, 2013 16:43
Working with multi-dimensional arrays of various sizes using constants and functions
var GROUP = 0;
var SUB_GROUP = 1;
...
releases[GROUP];
releases[SUB_GROUP];
function getGroup(data, releaseOffset) {
@ozten
ozten / promise_play.js
Created August 6, 2013 20:38
Playing with promises
var p = require("p-promise");
var promise = p.defer();
promise.then(function() {
fs.readFile("sample.json", 'utf8');
})
.then(function(data) {
var o = JSON.parse(data);
o.foo = "bar";
@ozten
ozten / os.rs
Last active December 20, 2015 07:19
How to use libc constants
//use libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR};
/*
rustc os.rs
os.rs:2:32: 2:36 error: unresolved import. maybe a missing `extern mod libc`?
os.rs:2 use libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR};
^~~~
os.rs:2:32: 2:39 error: failed to resolve import `libc::consts::os::posix88::S_IRUSR`
os.rs:2 use libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR};
^~~~~~~
@ozten
ozten / build_error.txt
Last active December 18, 2015 20:59
build_error
# Mac 10.7.5
# Installed go1.1.1.darwin-386.pkg from https://code.google.com/p/go/downloads/list
go run make.go
camlistore.org/pkg/rollsum
camlistore.org/pkg/fileembed/genfileembed
2013/06/22 23:28:48 Updating /Users/shout/Projects/camlistore/tmp/build-gopath/src/camlistore.org/server/camlistored/ui/zembed_base64.js.go (package ui)
2013/06/22 23:28:48 Updating /Users/shout/Projects/camlistore/tmp/build-gopath/src/camlistore.org/server/camlistored/ui/zembed_blob_item.css.go (package ui)
2013/06/22 23:28:48 Updating /Users/shout/Projects/camlistore/tmp/build-gopath/src/camlistore.org/server/camlistored/ui/zembed_blob_item.js.go (package ui)
...
@ozten
ozten / tbd_pyhawk_server.py
Created May 7, 2013 15:40
Early example of PyHawk Server APIs
import hawk
from hawk.util import HawkException
def credential_lookup(app_id):
# Config, filesystem, db or some other lookup
return credentials
server = hawk.Server(req, credential_lookup)
try:
@ozten
ozten / tbd_pyhawk_client.py
Last active December 17, 2015 02:08
Early PyHawk client sample
import hawk
import requests
credentials = {
'id': 'dh37fgj492je',
'key': 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
'algorithm': 'sha256'
}
@ozten
ozten / gist:5492908
Created May 1, 2013 00:25
Wherein I reinvent the server to server authentication wheel. Using HAWK instead.
Mozilla websites which consume the MozLDAP web services should do so in a secure manner.
1) They should be done of https
2) They should sign their requests
3) MozLDAP should verify request signatures, before servicing a request.
Each webapp would have to register the following:
@ozten
ozten / Fauxgermanhausen_bookmarklet.js
Created April 30, 2013 21:54
Fauxgermanhausen das Pagen! Bookmarklet
javascript:(function(){var%20prefixes=['','glocken','das','borfa','maushe','uber'],suffixes=['','hausen','%20die%20vander','gleuten','noshan','flagellan','mek','dak','en%20das','ga'],xPathResult=document.evaluate('.//text()[normalize-space(.)!=\'\']',document.body,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),i,textNode,cnt,out,j,pfx,sfx;for(i=0,l=xPathResult.snapshotLength;i<l;i++){textNode=xPathResult.snapshotItem(i);if(textNode.parentNode.nodeName.toLowerCase()=='script'||textNode.tagName=='style')continue;cnt=textNode.data.split(/\s/g);out=[];for(j=0;j<cnt.length;j++){if(cnt[j].replace(/[\s]/g,'')=='')continue;pfx=(!Math.floor(Math.random()*10))?'':prefixes[Math.floor(Math.random()*prefixes.length)];sfx=(!Math.floor(Math.random()*10))?'':suffixes[Math.floor(Math.random()*suffixes.length)];out.push(pfx+cnt[j]+sfx);}textNode.data='%20'+out.join('%20')+'%20';}})();
@ozten
ozten / contact_list_competative.md
Last active December 15, 2015 00:09
Contact List - Competitive Landscape

Drop box

Drop box - share photos with others

Drop box - share - import contacts

Drop box - share photos - auto complete

@ozten
ozten / saturday_dip.markdown
Last active December 14, 2015 19:28
Saturday Dip

On Saturday March 9th, 2013 there was a dip in login according to the Metrics Dashboard

Sign Ins were down 40%

3/8 37,978
3/9 12,919
3/10 31,675