Skip to content

Instantly share code, notes, and snippets.

Phil Dokas pdokas

Block or report user

Report or block pdokas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pdokas
pdokas / SassMeister-input.scss
Created Feb 3, 2016
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.3.2)
// ----
@mixin blue {
color: blue;
}
@mixin border {
border: 1px solid black;
}
@pdokas
pdokas / SassMeister-input.scss
Created Feb 3, 2016
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.3.2)
// ----
%blue {
color: blue;
}
%border {
border: 1px solid black;
}
@pdokas
pdokas / SassMeister-input-HTML.html
Created Feb 24, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="global-nav-container">hi</div>
@pdokas
pdokas / SassMeister-input-HTML.html
Created Feb 10, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="global-nav-container">hi</div>
View dabblet.css
label::after {
content: attr(title);
}
label {
/* padding-left */
}
label input {
height: 0;
View gist:7493326
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 Dec 19, 2015
The simplest way I can find to find a sorted list of all tags across all posts in Siteleaf.
View tags.html
{% 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 Mar 2, 2013
Flickr: Make a photo public and uploaded now
View gist:5072329
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 Feb 2, 2013
How can you delay an Ember.View’s DOM-based code until the Ember Data model has fully loaded?
View Ember view code & models.md

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) {
View ember.js build error
± ~/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
You can’t perform that action at this time.