This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
id: 1, | |
title: "Get Milk", | |
completed: false | |
}, | |
{ | |
id: 2, | |
title: "Have breakfast", | |
completed: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember.View.reopen({ | |
didInsertElement : function(){ | |
this._super(); | |
Ember.run.scheduleOnce('afterRender', this, this.afterRenderEvent); | |
}, | |
afterRenderEvent : function(){ | |
// implement this hook in your own subclasses and run your jQuery logic there | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
* {margin:0;} | |
body {background:#000000;} | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* lazyload.js (c) Lorenzo Giuliani | |
* MIT License (http://www.opensource.org/licenses/mit-license.html) | |
* | |
* expects a list of: | |
* `<img src="blank.gif" data-src="my_image.png" width="600" height="400" class="lazy">` | |
*/ | |
!function(window){ | |
var $q = function(q, res){ | |
if (document.querySelectorAll) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simple regex | |
Regex quick reference | |
[abc] A single character: a, b or c | |
[^abc] Any single character but a, b, or c | |
[a-z] Any single character in the range a-z | |
[a-zA-Z] Any single character in the range a-z or A-Z | |
^ Start of line | |
$ End of line | |
\A Start of string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pygmentize' # gem install pygmentize | |
require 'selenium-webdriver' # gem install selenium-webdriver | |
exit unless code_path = ARGV.shift | |
file_path = File.absolute_path 'code.html' | |
image_path = File.absolute_path 'code_image.png' | |
code = Pygmentize.process File.read(code_path), :ruby | |
html = <<-EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
TO DO | |
1) Reduce CSS duplication | |
- Ideally just a single build - global.scss turns into /build/global.css | |
- Can Autoprefixer output minified? | |
- If it can, is it as good as cssmin? | |
- Could Sass be used again to minify instead? | |
- If it can, is it as good as cssmin? |