Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View patrickjholloway's full-sized avatar

Patrick Holloway patrickjholloway

View GitHub Profile
class Workshop.Views.FontsIndex extends Backbone.View
el: '#content_wrapper'
initialize: ->
this.current_user = new Workshop.Models.Currentuser
this.current_user.fetch()
this.fonts = new Workshop.Collections.Fonts
this.fonts.fetch()
events:
'mouseenter span': 'whiteIcon'
@patrickjholloway
patrickjholloway / backbonewoes
Created December 5, 2012 19:48
backbone model woes
#OUTPUT
undefined
Currentuser {attributes: Object, _escapedAttributes: Object, cid: "c1", changed: Object, _silent: Object…}
_changing: false
_escapedAttributes: Object
_pending: Object
_previousAttributes: Object
_silent: Object
<script type="text/x-handlebars" data-template-name="photo">
<h2>{{title}}</h2>
<img {{ bindAttr src="imageUrl" title="title" alt="title" style="widthStyle"}}>
<p class="description">{{{description}}}</p>
<label/>Title<label/>
{{view Ember.TextField valueBinding="title"}}
<label/>Author<label/>
{{view Ember.TextField valueBinding="author"}}
<label/>Caption<label/>
{{view Ember.TextField valueBinding="caption"}}
let(:user){ FactoryGirl.create(:user, name: 'user_name') }
let(:project){ FactoryGirl.create(:project, name: 'project_name', description: 'project_description', owner: user, users: [user] ) }
let(:project_membership){ FactoryGirl.create(:project_membership, name: 'project_membership', user: user, project: project) }
@patrickjholloway
patrickjholloway / gist:7879397
Created December 9, 2013 19:35
git diff for my codez
commit fefdb75b6a6f99531fb8aaa29ee3a68572e26c8f
Author: Patrick Holloway <pholloway@patientslikeme.com>
Date: Mon Dec 9 14:32:22 2013 -0500
add ORE API calls to find and create survey invitations given a plm_user_id and a survey_session_id
diff --git a/lib/open_research_exchange.rb b/lib/open_research_exchange.rb
index 9e307ce..bddf3fa 100644
--- a/lib/open_research_exchange.rb
+++ b/lib/open_research_exchange.rb
fetchUserCount: function(){
Ember.$.getJSON('/s/1.json', function(data){
userData = JSON.parse(data);
this.content.set('userCount', userData.count); // or whatever your json contains
});
window.setTimeout(this.fetchUserCount, 5000);
@patrickjholloway
patrickjholloway / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@patrickjholloway
patrickjholloway / datalinks.json
Last active March 24, 2017 15:14
/datalinks json response body
#!/bin/zsh
mkdir ../stashes
git stash list| sed 's/\//\_/g'|sed 's/ /\_/g' | awk -F ":" '{ system("git stash show -p " $1 " >> \"../stashes/" substr($1$2$3, 0, 40) ".diff\"" ) }'
cd ..
rm -rf ./console
git clone git@github.com:Kinvey/console.git
cd ./console
#!/bin/zsh
mkdir ../stashes
git stash list| sed 's/\//\_/g'|sed 's/ /\_/g' | awk -F ":" '{ system("git stash show -p " $1 " >> \"../stashes/" substr($1$2$3, 0, 40) ".diff\"" ) }'
cd ..
rm -rf ./console
git clone git@github.com:Kinvey/console.git
cd ./console