Skip to content

Instantly share code, notes, and snippets.

View joshthecoder's full-sized avatar

Joshua Roesslein joshthecoder

View GitHub Profile
@joshthecoder
joshthecoder / gist:1654338
Created January 21, 2012 22:48
Using mobile devices as authentication devices.
QR code based authentication
============================
This would be mainly used when the user visits a site from a computer
besides their mobile device (ex: desktop). QR codes are used to initiate
a handshake.
User Experience
---------------
1. User visits site for the first time.
2. Site displays a QR code.
@joshthecoder
joshthecoder / gist:1631238
Created January 18, 2012 05:45
Wikipedia SOPA Blackout Flashlight :)
Here's a little trick to re-light wikipedia if you just can't go
without digesting some yummy wiki pages...
Chrome
------
1. Go to Preferences, Under the hood, Content settings.
2. Go to JavaScript section and click Manage exceptions.
3. Add entry: hostname = en.wikipedia.org behavior = block
4. Now load Wikipedia and enjoy!
@joshthecoder
joshthecoder / gist:1628511
Created January 17, 2012 20:01
Wikipedia - SOPA Blackout
How does blacking out a site help educate others what SOPA is and why it should be fought?
In my honest and humble opinion http://en.wikipedia.org/wiki/SOPA is our greatest weapon. Knowledge.
Many people, myself included, may have heard "SOPA", but never knew what it really meant. It is information
like that provided on Wikipedia which helps educate people so they can make knowledgeable discussions.
Without this knowledge we become blind and defenseless. If this blackout should accomplish anything, it will
turn off the lights and leave us wondering in the dark.
I recommend that Wikipedia and it's editors reconsider their action and choose the
more well lighted path to educating the people of SOPA. I suggest the landing page of wikipedia
be redirected to the SOPA wiki page. While I would prefer to keep all other pages online during this campaign to
static Persistent<Function> isNaN;
bool V8Util::isValueNaN(Handle<Value> value)
{
HandleScope scope;
if (isNaN.isEmpty()) {
Local<Object> global = Context::GetCurrent()->Global();
Local<Value> isNaNValue = global->Get(String::NewSymbol("isNaN"));
isNaN = Persistent<Function>::New(isNaNValue.As<Function>());
@joshthecoder
joshthecoder / gist:1167392
Created August 24, 2011 05:54 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: programmer for Appcelerator, Inc.
Favorite Python project: pypy
Favorite Conference: CodeConf!
Python Experience Level: Experienced
@joshthecoder
joshthecoder / Questions
Created June 20, 2011 23:41
Kiwi Pycon Give-away
GitHub username: joshthecoder
Day job: Software developer for Appcelerator working on Titanium Desktop.
Favorite open source project: Titanium
Open Source contributions (if any): Can't remember how many, but I do spend in my spare time sending patches to many projects.
Stranded on an island, what 3 items do you take: knife, tent, a good book
Tie-breaker, pick a number between 1 and 20,000: 19,999
/*
* event-emitter-plus.js
*
* An extended EventEmitter with the following new additions:
* + mapEvents(events) - Add the following listeners to the event specified by their key.
*/
events = require("events");
events.EventEmitter.prototype.mapEvents = function (events) {
/*
Using the streaming API to pump data
read from a socket into a file.
*/
// Assume we have opened both a socket and file.
var socket = ...;
var file = ...;
// First create a pump object to perform the transfer of data.
import tweepy
auth = tweepy.OAuthHandler(consumer_token, consumer_secret)
auth.get_xauth_access_token(username, password)
# you can then use this for API access...
api = tweepy.API(auth)
api.update_status("hello")
# to get the access token object for storing...
Colors: enum { red, blue, green }
Animals: enum {
monkey
bird
cow
dog
}