Skip to content

Instantly share code, notes, and snippets.

View edwardsharp's full-sized avatar
🥺
i'm a teapot

edward sharp edwardsharp

🥺
i'm a teapot
View GitHub Profile
@edwardsharp
edwardsharp / e.js
Created August 15, 2012 02:24
cordova-2.0.0 FileWriter issue
var CREDENTIALS_FILE_NAME = "credentials.json";
var credentials;
// INIT -- Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, initCredentialReader, fail);
}
function initCredentialReader(fileSystem) {
fileSystem.root.getFile(CREDENTIALS_FILE_NAME, {create: true}, gotFileEntryReader, fail);
@edwardsharp
edwardsharp / uainit.js
Created October 9, 2012 04:36
#urbanairship
document.addEventListener("deviceready", function() {
// BEGIN UA PUSH NOTIFICATION INIT
push = window.pushNotification;
// Callback for when a device has registered with Urban Airship.
// https://docs.urbanairship.com/display/DOCS/Server%3A+Android+Push+API#ServerAndroidPushAPI-Registration
push.registerEvent('registration', function (id) {
console.log("Registered with ID: " + id)
});
// Callback for when the app is running, and recieves a push.
@edwardsharp
edwardsharp / gist:5223010
Created March 22, 2013 17:07
pwirks CLOC
beuys-2:partywirks edward$ /Users/edward/src/tower/smc/edward/perl/cloc.pl .
2970 text files.
2742 unique files.
7937 files ignored.
http://cloc.sourceforge.net v 1.56 T=24.0 s (103.8 files/s, 12480.4 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
Javascript 496 17223 20020 96188
var module = {
getUser: function() {
return this.user;
},
user: "jim user"
};
> undefined
module.getUser();
> "jim user"
//this could be another annon function!
@edwardsharp
edwardsharp / hotlist.pd
Created September 29, 2013 04:51
wondering about a better way, if going through a spigot, to get all the cold sliders to act like hot ones...
#N canvas 0 22 410 576 10;
#X obj 242 39 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-262144 -1 -1 226.89 256;
#X obj 242 60 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-262144 -1 -1 0 256;
#X obj 243 81 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-262144 -1 -1 0 256;
#X obj 244 103 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-262144 -1 -1 116.457 256;
#X obj 19 -225 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
@edwardsharp
edwardsharp / drone07.pd
Created November 26, 2013 16:52
drone07.pd
#N canvas 0 0 500 500 ;
#X obj 299 414 osc~ 44;
#X obj 100 118 osc~ 8.3;
#X obj 200 118 osc~ 1.5;
#X obj 150 177 *~;
#X obj 399 118 osc~ 7.5;
#X obj 499 118 osc~ 0.1;
#X obj 449 177 *~;
#X obj 299 237 *~;
#X obj 299 296 *~ 88;
@edwardsharp
edwardsharp / bourbon.pd
Created November 26, 2013 16:53
bourbon.pd
#N canvas 0 22 1169 730 10;
#X obj 5 117 metro;
#X obj 48 -54 tgl 15 0 empty empty empty 17 7 0 10 -260097 -257985
-1 0 127;
#X obj 67 -54 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-260097 -257985 -1 66 256;
#X obj 5 140 f;
#X obj 39 140 + 1;
#X obj 1 -40 hradio 16 1 0 10 empty empty empty 0 -8 0 10 -260097 -257985
-1 0;
@edwardsharp
edwardsharp / thickbox.js
Created January 16, 2014 19:40
thickbox.js iPad scrolling hack
jQuery(document).ready(function(){
// start hack #sorry
if ("ontouchstart" in document.documentElement){
jQuery('html').addClass('touch');
}
var style = document.createElement('style');
style.type = 'text/css';
hackystyle = '.touch #TB_window {height: 90%; -webkit-overflow-scrolling: touch !important;overflow: scroll !important;}';
if (style.styleSheet) {
// IE
@edwardsharp
edwardsharp / sinefeld.pd
Created February 24, 2014 00:31
sinefeld PD INTRO WRKSHP
#N canvas 26 120 658 414 10;
#X obj 51 110 noise~;
#X obj 83 169 *~;
#X obj 138 133 vline~;
#X msg 138 96 1 2 \, 0 2 2;
#X obj 379 297 dac~;
#X obj 83 289 delwrite~ string1 100;
#X obj 380 65 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 2700 1;
#X obj 377 231 vd~ string1 20;
@edwardsharp
edwardsharp / 00_intro.pd
Last active August 29, 2015 14:02
intro00
#N canvas 217 47 886 608 10;
#X obj 16 705 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-262144 -1 -1 0 256;
#X obj 16 763 print;
#X text 53 245 ctrl/cmd + e to switch;
#X text 190 245 between edit (finger cursor);
#X text 55 277 & play mode (black arrow);
#X text 47 470 Edit -> Autopatch;
#X text 80 482 will automatically connect new atoms;
#X text 301 482 to previously selected one;