Skip to content

Instantly share code, notes, and snippets.

View octatone's full-sized avatar

Raymond May Jr. octatone

View GitHub Profile
@octatone
octatone / gist:993980
Created May 26, 2011 20:17
usage for blog buttons
button_options = document.createElement( 'script' );
button_options.type = 'text/javascript';
button_options.text = "reddit_url = '" + data.songs.song[0].reddit_url + "';\n";
button_options.text += "reddit_title = '" + data.songs.song[0].reddit_title + "';\n";
button_options.text += "reddit_target = 'radioreddit';\n";
button_options.text += "reddit_newwindow = 1;\n";
button_script = document.createElement( 'script' );
button_script.type = 'text/javascript';
button_script.src = 'http://reddit.com/static/button/button1.js';
@octatone
octatone / gist:994485
Created May 27, 2011 01:35
iad plug fail
Undefined symbols for architecture i386:
"_OBJC_METACLASS_$_PhoneGapDelegate", referenced from:
_OBJC_METACLASS_$_AppDelegate in AppDelegate.o
"_OBJC_CLASS_$_PhoneGapDelegate", referenced from:
_OBJC_CLASS_$_AppDelegate in AppDelegate.o
"_OBJC_METACLASS_$_PhoneGapCommand", referenced from:
_OBJC_METACLASS_$_SAiOSAdPlugin in SAiOSAdPlugin.o
"_OBJC_CLASS_$_PhoneGapCommand", referenced from:
_OBJC_CLASS_$_SAiOSAdPlugin in SAiOSAdPlugin.o
ld: symbol(s) not found for architecture i386
@octatone
octatone / phonegap failsauce
Created May 27, 2011 20:13
reddit api fiddlin'
/*
reddit api javascript interface for phonegap
requires: jquery
requires: external hosts reddit.com, www.reddit.com in phonegap plist
*/
var reddit = new function() {
/*
* globals
*/
@octatone
octatone / dabblet.css
Created March 2, 2012 05:10
A "deeper" indented text effect with the :before and :after pseudo-elements.
/**
* A "deeper" indented text effect with the :before and :after pseudo-elements.
*/
html, body {
height: 100%;
}
body {
margin: 0;
background: #0A539C;
background: linear-gradient(top, #4293d6 0%,#001e96 100%);
@octatone
octatone / gist:5840817
Last active December 18, 2015 20:29
bytebeats
// http://wurstcaptures.untergrund.net/music/
t * ((t>>8 | t >>2) &t>>>1 >> 12);
l: t * ((t>>32 | t >>12) &12 &t>>>0 >> 7) + t
r: t * ((t>>32 | t >>12) &12 &t>>>1 >> 7) + t
l: t * ((t>>32 | t >>12 | t >> 3) &3 &t>>>0 >> 9) >> (t/8000 * 30)
r: t * ((t>>32 | t >>12 | t >> 3) &6 &t>>>1 >> 9) >> (t/8000 * 30)
// 44100
@octatone
octatone / arrays.js
Last active August 29, 2015 14:08
Co - working with arrays of generators
'use strict';
const request = require('request'),
promisify = require('es6-promisify'),
get = promisify(request.get),
co = require('co'),
okay = /^2/,
sites = [
'https://www.google.com',
'https://www.twitter.com',
@octatone
octatone / access-token.clj
Created October 26, 2014 09:41
Getting an access token from Twitter
(defn get-token []
(let [options {
:basic-auth [app-consumer-key app-consumer-secret]
:form-params {:grant_type "client_credentials"}}
result (client/post token-url options)
body-json (json/read-str (:body result) :key-fn keyword)]
(:access_token body-json)))
@octatone
octatone / get-twitter-token.js
Created October 26, 2014 09:48
Fetch a Twitter api access token in using a generator function.
function *getToken () {
let options = {
'auth': {
'user': appConsumerKey,
'pass': appConsumerSecret,
'sendImmediately': true
},
'form': {
'grant_type': 'client_credentials'
}
@octatone
octatone / get-6w-tweets.js
Created October 26, 2014 10:03
Fetch 6w tweets using a generator
function *get6wTweets () {
let options = {
'auth': {
'bearer': yield getToken
}
},
response = yield get(searchUrl, options);
return parse(response.body).statuses;
}
@octatone
octatone / main.js
Created October 26, 2014 10:15
Main entry point via self-executing controller.
co(function *main () {
(yield get6wTweets).forEach(printStatus);
})();