Skip to content

Instantly share code, notes, and snippets.

View tauren's full-sized avatar

Tauren Mills tauren

View GitHub Profile
@tauren
tauren / gist:1071122
Created July 8, 2011 04:11
Git branch question

Ubuntu dev system (godzilla)

On my main development system, I've done a bunch of commits to master. No changes have been made to other branches. I successfully push my commits to my remote git repository.

tauren@godzilla:/projects/git/myproject$ git branch -a
* master
  remotes/origin/accounting
  remotes/origin/master
  remotes/origin/organizations

remotes/origin/registration

@tauren
tauren / Base.coffee
Created July 12, 2011 21:15
Can't run compiled coffeescript through jshint
SZ.models.Base = Backbone.Model.extend {}
@tauren
tauren / output.txt
Created August 14, 2011 20:53
Fails jshint
creampie:common-client tauren$ cake smoosh
*********************************************************************
###### ## ## ####### ####### ###### ## ##
## ## ### ### ## ## ## ## ## ## ## ##
## #### #### ## ## ## ## ## ## ##
###### ## ### ## ## ## ## ## ###### #########
## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ##
###### ## ## ####### ####### ###### ## ##
size = (obj) ->
s = 0
for own key of obj
s++
s
creampie:github tauren$ npm list -g
/usr/local/lib
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
Integer filled = new Integer(value);
if (filled != null) {
switch (filled) {
case 4: // Unassigned games - Games with no assignments filled
// Pseudocode: select games where count(assignments with status = ACCEPTED) = 0 and count(positions) > 0
search.addFilterNone("assignments", Filter.equal("statusCode",AssignmentStatus.ACCEPTED.getCode()));
search.addFilterGreaterThan("schedule.positions.size", 0);
break;
case 3: // Partially assigned games - Games with some assignments filled
// Pseudocode: select games where count(assignments with status = ACCEPTED) < count(positions)
@tauren
tauren / footer.php
Created January 1, 2012 22:45
Sample wordpress template files
renderTemplate: function(model, extras) {
var json = {
'orders': [
{'id':'o12345','status':'Shipped','ordered':'2011-06-01'},
{'id':'o34567','status':'Pending','ordered':'2011-07-01'},
{'id':'o56789','status':'Shipped','ordered':'2011-08-01'}
]
};
var tmpl = 'script#ordersTmpl';
var html = Plates.bind($(tmpl).html(), json);
var html = $('script#todo').html();
var data = {
content: 'Todo item',
done: false
};
var map = Plates.Map();
map.class('todo-content').to('content');
// Bind all of an object's methods to a specific context. Useful for ensuring that
// all callbacks defined on an object belong to it.
var context = function(obj, ctx) {
var funcs = Array.prototype.slice.call(arguments, 2);
if (funcs.length == 0) funcs = _.functions(obj);
_.each(funcs, function(f) { obj[f] = _.bind(obj[f], ctx); });
return obj;
};