This file contains hidden or 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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
// current way | |
@function strip-units($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
// new way |
This file contains hidden or 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
<article> | |
<p>First paragraph</p> | |
<p>Second paragraph</p> | |
<p></p> | |
<p>Third paragraph</p> | |
</article> |
This file contains hidden or 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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.7) | |
// ---- | |
=e($name) | |
@at-root #{&}__#{$name} | |
@content | |
=m($name) | |
@at-root #{&}--#{$name} |
This file contains hidden or 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
/** | |
* localStorage abstraction | |
* Get and Set JS Objects in localStorage | |
* | |
* This is meant for really simple localStorage needs, not to replace | |
* anything like Backbone.localStorage that's more robust. A good | |
* use-case is storing an array of IDs for models that are stored on | |
* the server. | |
* | |
* Usage: |
This file contains hidden or 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
d3=function(){function t(t){return t.target}function n(t){return t.source}function e(t,n){try{for(var e in n)Object.defineProperty(t.prototype,e,{value:n[e],enumerable:!1})}catch(r){t.prototype=n}}function r(t){for(var n=-1,e=t.length,r=[];e>++n;)r.push(t[n]);return r}function u(t){return Array.prototype.slice.call(t)}function i(){}function a(t){return t}function o(){return!0}function c(t){return"function"==typeof t?t:function(){return t}}function l(t,n,e){return function(){var r=e.apply(n,arguments);return r===n?t:r}}function f(t){return null!=t&&!isNaN(t)}function s(t){return t.length}function h(t){return t.trim().replace(/\s+/g," ")}function g(t){for(var n=1;t*n%1;)n*=10;return n}function p(t){return 1===t.length?function(n,e){t(null==n?e:null)}:t}function d(t){return t.responseText}function m(t){return JSON.parse(t.responseText)}function v(t){var n=Li.createRange();return n.selectNode(Li.body),n.createContextualFragment(t.responseText)}function y(t){return t.responseXML}function M(){}function b(t){functio |
This file contains hidden or 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
#!/bin/bash | |
# | |
# $ git sync | |
# Pulling from remote... | |
# Current branch master is up to date. | |
# | |
# Pushing to remote... | |
# Everything up-to-date | |
# |
This file contains hidden or 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
require 'storable' | |
require 'faker' | |
module ViewHelpers | |
# … | |
# Data Faking | |
class Subscriber < Storable | |
field :id => Integer | |
field :first_name |
This file contains hidden or 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
# Example of Subscriber.all (assumes you've defined the Subscriber class): | |
irb > Subscriber.bootstrap("./subscribers.yml") | |
irb > Subscriber.all | |
=> [#<Subscriber:0x007ffaf1ad85b0 @first_name="Mike", @id=1, @last_name="Tierney">, #<Subscriber:0x007ffaf29f07a0 @first_name="Martin", @id=2, @last_name="Arrowsmith">] |
This file contains hidden or 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
<h1>All Subscribers</h1> | |
<ul> | |
<% Subscribers.all.each do |subscriber| %> | |
<li> | |
<strong><%= subscriber.name %></strong> | |
<span class="sub-since">Subscriber Since <%= subscriber.created_at %></span> | |
</li> | |
<% end %> | |
</ul> |
This file contains hidden or 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
<% 10.times do |i| %> | |
<% | |
# Define these first, since they're being used in the key | |
first_name = Faker::Name.first_name | |
last_name = Faker::Name.last_name | |
%> | |
"<%= first_name %>_<%= last_name %>": | |
id: <%= i + 100 %> |
NewerOlder