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
// **************** | |
// **** NORMAL **** | |
// **************** | |
// COMPASS: | |
// Best order for font-files is WOFF->TTF->SVG while the EOT is a separate parameter for font-face | |
// Best weight and style order is Regular->Bold->Italic->Bold+Italic | |
@include font-face("Aller", font-files("aller_rg-webfont.woff", "aller_rg-webfont.ttf", "aller_rg-webfont.svg"), "aller_rg-webfont.eot"); | |
@include font-face("Aller", font-files("aller_bd-webfont.woff", "aller_bd-webfont.ttf", "aller_bd-webfont.svg"), "aller_bd-webfont.eot", bold); | |
@include font-face("Aller", font-files("aller_it-webfont.woff", "aller_it-webfont.ttf", "aller_it-webfont.svg"), "aller_it-webfont.eot", normal, italic); |
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
var debounce_timer = null; | |
$(window).resize(function(e) { | |
window.clearTimeout(debounce_timer); | |
debounce_timer = window.setTimeout(function() { | |
$(document).trigger("gh:resize"); | |
}, 200); | |
}); | |
$(document).on("gh:resize", function(e) { |
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
if (window.self !== window.top) { | |
window.top.location.href = window.self.location.href; | |
} |
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
files.sort! { |a, b| | |
[a, b] | |
.map { |s| s[/_(\d+).jpg/, 1].to_i } | |
.inject(:"<=>") | |
} |
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
class Wireframe < ActiveRecord::Base | |
def self.columns | |
@columns ||= []; | |
end | |
def self.column(name, sql_type = nil, default = nil, null = true) | |
columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) | |
end | |
def method_missing(method_id, *args, &block) |
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
# Note does not ever include 5 | |
((rand * 5) * 2).round / 2.0 |
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
# Credit to https://github.com/jdpedrie/angularjs-ordinal-filter (which also doesn't work for 11, 12 and 13) | |
ghostBooking.filter "ordinal", -> | |
(number) -> | |
suffixes = ["th", "st", "nd", "rd"] | |
value = number % 100 # The last two digits, e.g. 12345 % 100 => 45 | |
number + (suffixes[(l2d - 20) % 10] || suffixes[0]) |
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
values = (0..12).to_a | |
values.product(values).each do |factors| | |
product = factors[0] * factors[1] | |
puts "#{factors[0]} x #{factors[1]} = #{product}" | |
end |
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
AllCops: | |
RunRailsCops: true | |
# Fails in 0.21.0 | |
Delegate: | |
Enabled: false |
OlderNewer