Skip to content

Instantly share code, notes, and snippets.

View OscarGodson's full-sized avatar
:shipit:
Workin'

Oscar Godson OscarGodson

:shipit:
Workin'
  • CTO
  • Portland, OR
  • 11:47 (UTC -07:00)
View GitHub Profile
<html class="js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms no-csstransforms3d csstransitions no-fontface no-generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchang
/**
* parseTemplate takes a string and a JS Object and returns a string with template
* replaced with content you provided. Template tags look like: {{tag}}
* @param {String} s This is the string to search for tags in.
* @param {Object} j This is the JS object that contains a key=>value pair for the tag and what to be replaced
* @returns {String} returns the modified string with the content you provided in replacement of the tags
* @example var html = parseTemplate('Hey, {{name}}',{ name:'John' }); //returns "Hey, John"
*/
var parseTemplate = function(s,j){
for(x in j){ var r = new RegExp('{{'+x+'}}','g'); s = s.replace(r,j[x]); }
/*!
* jQuery JavaScript Library v1.7.1
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
Sign Up
Splash Page
click sign up -> Phone Number Page
click log in -> Login Page
Phone Number Page
back -> Splash Page
Phone Number Input Active*
typed -> Phone Number Input Entry
@OscarGodson
OscarGodson / connect_mongohq_node.js
Created September 11, 2011 04:25
How to connect to MongoHQ with Node + node-mongodb-native
/**
* To get all the info to login, sign into your MongoHQ account, go to the db you want,
* click the "Database Info" tab, then look for the line that looks like:
* -------------------------------------------------------------
* mongodb://<user>:<password>@staff.mongohq.com:10056/node-test
* ---------| |-| |------------------| |-| |
* USER PASSWORD PORT DB NAME
*
* ALSO, for testing, you should manually add a document and collection into MongoHQ
* from their "Add a Collection" > "Add a Document" links, then below we'll log it.
// We'll wrap our app in the "app" namespace
app = {
model: {}
, view: {}
, controller: {}
};
// Setup our data if this is the first time opening our app
app.data = {

My fave "not corny" horror films

Bedevilled

My all time favorite revenge horror, and one of my all time favorite movies in general.

Netflix

@OscarGodson
OscarGodson / README.md
Created December 31, 2013 20:09
Window swapping in vim

To use (assuming your mapleader is set to ) you would:

  1. Move to the window to mark for the swap via ctrl-w movement
  2. Type \mw
  3. Move to the window you want to swap
  4. Type \pw
$('parent').addEvent('click:relay(#child)', function () {
alert('test');
});
$('parent').fireEvent('click', { target: $('child') });

As pictured by philosophers, science is a supremely rational activity. Yet the history of science shows scientists flouting the rules of scientific method. Not only the origins but the progress of science comes from acting against reason.

- John Gray