Skip to content

Instantly share code, notes, and snippets.

View pdokas's full-sized avatar
🌵
Fnord

Phil Dokas pdokas

🌵
Fnord
View GitHub Profile
Emphasis: https://github.com/NYTimes/Emphasis
announcement: http://open.blogs.nytimes.com/2011/01/11/emphasis-update-and-source/
source: https://github.com/NYTimes/Emphasis/blob/master/js/emphasis-src.js
location on nytimes.com: http://graphics8.nytimes.com/js/app/common/emphasis/app.js
Cortex: http://cortexapp.com/
--
The problem
@pdokas
pdokas / svn-color.py
Created October 6, 2011 20:03
Colorize SVN
#
# 1) Alias this: alias svn=/Users/foo/dev/svn-color.py
# 2) Paste the script below into the above file
# 3) chmod 777 <the file>
# 4) Delete this quote block so the env line is line 1
#
#!/usr/bin/env python
"""
@pdokas
pdokas / svn-color.py
Created March 28, 2012 18:37 — forked from rharmes/svn-color.py
Colorize SVN
#
# 1) Alias this: alias svn=/Users/foo/dev/svn-color.py
# 2) Paste the script below into the above file
# 3) chmod 777 <the file>
# 4) Delete this quote block so the env line is line 1
#
#!/usr/bin/env python
"""
± ~/dev/ember.js (master ✓) ⚡ rake -V
rake, version 10.0.3
± ~/dev/ember.js (master ✓) ⚡ rake dist
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25: warning: redundant nested repeat operator
rake aborted!
cannot load such file -- bundler/setup
/Users/pdokas/dev/ember.js/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)
± ~/dev/ember.js (master ✓) ⚡ rake dist --trace
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25: warning: redundant nested repeat operator
@pdokas
pdokas / Ember view code & models.md
Created February 2, 2013 19:44
How can you delay an Ember.View’s DOM-based code until the Ember Data model has fully loaded?

Ember’s ability to automatically re-render a view when its model changes is awesome. Like “holy shit, that was basically magic” awesome. But there’s a common task that’s so similar but perplexingly more difficult. It’s using data from the model’s records in the view’s jQuery code (or really any clientside DOM library, but Ember bundles jQuery, so let’s be simple and assume jQuery).

For instance, if this is my router:

App.IndexRoute = Ember.Route.extend({
	model: function(params) {
		return App.Gallery.find();
	},
	setupController: function(controller, model) {
@pdokas
pdokas / gist:5072329
Created March 2, 2013 18:18
Flickr: Make a photo public and uploaded now
javascript:(function(){if(confirm('This will set the date posted to now, and make the photo public for all to see.')){FLICKR.photo.setDatePosted(Math.round((new Date()).getTime()/1000));FLICKR.photo.setPerms({is_public:1});}})();
@pdokas
pdokas / tags.html
Last active December 19, 2015 15:48
The simplest way I can find to find a sorted list of all tags across all posts in Siteleaf.
{% capture tags %}
{% for post in site.posts %}
{% for tag in post.taxonomy.tags %}
{{tag.value}}\{{tag.url}}{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endfor %}
{% endcapture %}
{% assign tags = tags | strip_newlines | split:',' | sort %}
var asap = (function(global) {
"use strict";
// Use the fastest possible means to execute a task in a future turn
// of the event loop.
// linked list of tasks (single, with head node)
var head = {task: void 0, next: null};
var tail = head;
var flushing = false;
label::after {
content: attr(title);
}
label {
/* padding-left */
}
label input {
height: 0;
@pdokas
pdokas / SassMeister-input-HTML.html
Created February 10, 2015 00:40
Generated by SassMeister.com.
<div class="global-nav-container">hi</div>