Skip to content

Instantly share code, notes, and snippets.

View pdokas's full-sized avatar
🌵
Fnord

Phil Dokas pdokas

🌵
Fnord
View GitHub Profile
@pdokas
pdokas / SassMeister-input.scss
Created February 3, 2016 21:48
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
@mixin blue {
color: blue;
}
@mixin border {
border: 1px solid black;
}
@pdokas
pdokas / SassMeister-input.scss
Created February 3, 2016 21:47
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
%blue {
color: blue;
}
%border {
border: 1px solid black;
}
@pdokas
pdokas / SassMeister-input-HTML.html
Created February 24, 2015 18:25
Generated by SassMeister.com.
<div class="global-nav-container">hi</div>
@pdokas
pdokas / SassMeister-input-HTML.html
Created February 10, 2015 00:40
Generated by SassMeister.com.
<div class="global-nav-container">hi</div>
label::after {
content: attr(title);
}
label {
/* padding-left */
}
label input {
height: 0;
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;
@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 %}
@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 / 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) {
± ~/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