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
############################## | |
############################## | |
robot_in_the_cloak: "Robot in the Cloak" | |
site_title: "#iOSonRailsConf 2013" | |
site_description: "Eine Konferenz für Ruby on Rails und iOS-Entwickler aus aller Welt, die im Frühjahr 2013 in Aluschta stattfinden wird." | |
site_description_short: "Ruby on Rails und iOS-Entwickler Konferenz." | |
site_keywords: "Ruby, Rails, ios, Entwickler, Konferenz, 2013, Web, Handy, iphone, ipad, ipod" |
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
# http://24ways.org/2010/calculating-color-contrast | |
def contrast_color(hex_color, dark_option, bright_option) | |
rgb = hex_to_rgb(hex_color) | |
yiq = luminance(*rgb) / 1000 | |
yiq >= 128 ? dark_option : bright_option | |
end | |
def hex_to_rgb(hex_color) | |
hex_color = hex_color.gsub(%r{[#;]}, '') | |
case hex_color.size |
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
function html() { | |
curl -o ${1-index.html} https://gist.github.com/polarblau/4135905/raw/361a71ab43012ab149744fa4bd4a0e837d0a0200/index.html | |
} |
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
// ... | |
$color-variation: 10% | |
$color-set-1: $dark-violet $dark-green $orange | |
$color-set-2: $gray $bright-violet $bright-green | |
$color-set-3: $turquoise $yellow $red | |
$color-sets: $color-set-1 $color-set-2 $color-set-3 | |
=color($property: color, $level: 1, $variation: 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
# http://bateru.com/news/2011/03/javascript-standard-deviation-variance-average-functions/ | |
getNumWithSetDec = (num, numOfDec = 3) -> | |
pow10s = Math.pow(10, numOfDec) | |
(if (numOfDec) then Math.round(pow10s * num) / pow10s else num) | |
getAverageFromNumArr = (numArr, numOfDec) -> | |
return false unless _.isArray(numArr) | |
i = numArr.length | |
sum = 0 | |
sum += numArr[i] while i-- |
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
:docs | |
Template Name: Home | |
- content_for :page_lift do | |
= partial "home_lift" | |
%article | |
.content-wrapper | |
= php "if (have_posts()):" do | |
= php "while (have_posts()): the_post()" do |
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
$ = jQuery | |
$.fn.extend | |
foobar: (method) -> | |
settings = | |
option1: true | |
option2: 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
class Hash | |
def merge_html_attr!(other) | |
merged = self.merge(other) do |key, a, b| | |
if key == :class && a.is_a?(String) && b.is_a?(String) | |
[a, b].join(' ') | |
else | |
b | |
end | |
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
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f%3De.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc%3Da.createElement(%22script%22)%3Bc.type%3D%22text/javascript%22%3Bc.src%3D%22//ajax.googleapis.com/ajax/libs/jquery/%22%2Bg%2B%22/jquery.min.js%22%3Bc.onload%3Dc.onreadystatechange%3Dfunction()%7Bif(!b%26%26(!(d%3Dthis.readyState)%7C%7Cd%3D%3D%22loaded%22%7C%7Cd%3D%3D%22complete%22))%7Bh((f%3De.jQuery).noConflict(1),b%3D1)%3Bf(c).remove()%7D%7D%3Ba.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.8.0%22,function(%24,L)%7Bvar%20loc%3D%24(%22iframe.iFrameStyle%22).attr(%22src%22)%3Bvar%20win%3Dwindow.open(loc)%3Bwin.print()%3B%7D)%3B |
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
options = { :wait => 10 } | |
# one big set | |
result = Crawler.crawl("http://www.example.com", options) | |
result.image | |
result.style_sheets | |
result.scripts # => [<Crawler::Response::Script>] | |
... | |
result.errors |