Skip to content

Instantly share code, notes, and snippets.

View jpcody's full-sized avatar

Joshua Cody jpcody

View GitHub Profile
@jpcody
jpcody / css_hooks.js
Created October 24, 2011 14:01
CSS Hooks with support for forcing 2d animations
// ==========================================================================
// Project: TransformJS
// Copyright: ©2011 Strobe Inc.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
require('TransformJS/sylvester');
(function($) {
@jpcody
jpcody / upload-clipboard.rb
Created September 3, 2011 01:06
Save clipboard contents as private gist using Alfred.app
# It'd be great to get this running via AppleScript and sans Alfred if anyone with more knowledge than me knows how :)
### STEP 1
#!/bin/sh
# Save this file as /bin/rvm_ruby, and do chmod 755 /bin/rvm_ruby
# to give it the proper permissions
# From http://www.aeonscope.net/2011/05/29/connecting-alfred-to-bitly-via-ruby/
if [[ -s ~/.rvm/scripts/rvm ]]; then
/* Reused elements */
.button
background: url('../img/buttons.png')
display : block
height : 32px
text-indent : -9999px
width : 130px
&.download
background-position: -162px 0
/**
* QUESTION MAINTENANCE OPERATIONS
*
* This object contains the code to handle question maintenance. That includes, but is
* not limited to, switching to view administrative vs applicant questions, updating the
* qualification status of a given question, and selecting a new question to add.
*
*/
SM.adminQuestions = {
init : function(){
// the app uses javascript only for effects and the tiniest bit of data manipulation, so a
// full-stack framework doesn't necessarily make sense. I'm really looking to organize all
// of the effects we're doing throughout the app.
var NS = {};
NS.controllerName = {
init : function(){
this.doDomBindings();
// create a master object
var myObj = {};
myObj.nestedObj = {};
// create a nested object
myObj.nestedObj = {
myReturns : {
first : 'foo',
second : 'bar'
var myObj = {};
myObj.nestedObj = {
myReturns : {
first : 'foo',
second : 'bar'
},
myCaller : function(){
//used to have
var someObjOld = {
int1 : {},
int2 : {},
int3 : { function(){ this.int4(); }},
int4 : {}
};
// now have
var someObj = {
var someObj = {
// wtf? 2 names?
myFunc : function myAlias(){
// deep nesting
// deep nesting
// deep nesting
// deep nesting
// oh no, i need to call myself!
// run this first on the console
var script= document.createElement('script');
script.src= 'https://raw.github.com/documentcloud/underscore/master/underscore-min.js';
document.head.appendChild(script);
// then run this
var someObj = {