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 ['jquery', 'calculator'], ($, Calculator) -> | |
$ -> | |
calc = new Calculator() | |
alert calc.add(4, 8) | |
calc.paint('#item') |
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
# http://blog.jambura.com/2013/03/27/test-your-websites-features-in-firefox-safari-and-chrome-using-rspec-and-capybara-with-selenium/ | |
# brew install go | |
# git clone --depth 1 https://github.com/SeleniumHQ/selenium.git | |
# https://developer.apple.com/account/safari/certificate/ | |
# selenium/go safari | |
# open build/javascript/safari-driver/ | |
# Safari > Develop > Show Extension Builder > Add Extension | |
Capybara.register_driver :safari do |app| | |
Capybara::Selenium::Driver.new(app, :browser => :safari) | |
end |
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 'date' | |
- require 'active_support' | |
- @d = Date.today | |
- @week1 = @d.beginning_of_month.beginning_of_week(:sunday) | |
- @weekn = @d.end_of_month.end_of_week(:sunday) | |
- @weeks = (@week1..@weekn).to_a.in_groups_of(7) | |
- content_for :head do | |
link[href='/test/table/calendar2.css' rel='stylesheet']/ |
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
define -> | |
class Detect | |
ios: -> | |
if @ipad() or @ipod() | |
# supports iOS 2.0 and later: <http://bit.ly/TJjs1V> | |
v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/) | |
return [true, parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)] | |
else | |
return [false] |
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
# https://gist.github.com/ptb/5809531 | |
# rvm use --create ruby-2.1.1@#{app_name} | |
# gem install rails | |
# rails new app -J -T -m ~/Dropbox/template.rb | |
run 'gem update' | |
create_file '.ruby-version' do <<-RUBY_VERSION | |
2.1.1 |
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
SEED = 12345678901 | |
def self.find_by_token(token) | |
id = token.reverse.to_i(36) - Thing::SEED | |
find(id) | |
end | |
def token(input = self.to_param) | |
(input.to_i + Thing::SEED).to_s(36).reverse | |
end |
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
!!! 5 | |
%html{:lang => 'en', :xmlns => 'http://www.w3.org/1999/xhtml'} | |
%head | |
%meta{:charset => 'utf-8'}/ | |
%title CSS Reference and Sort Order | |
:sass | |
body | |
counter-reset: linenumbers |
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
<!DOCTYPE html> | |
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<meta charset='utf-8'> | |
<title>CSS Reference and Sort Order</title> | |
<style> | |
body { | |
counter-reset: linenumbers; | |
margin-left: 2em; } | |
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
.loading::after{display:inline-block;content:'';width:20px;height:20px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%238c8c8c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2f%3e%3cuse%20xlink%3ahref%3d'%23l'%20opacity%3d'.27'%20transform%3d'rotate(60%2060%2c60)'%2f%3e%3cuse%20xlink%3ahref%3d'%23l'%20opacity%3d'.27'%20transform%3d'rotate(90%2060%2c60)'%2f%3e%3cuse%20xlink%3ahref%3d'%23l'%20opacity%3d'.27'%20transform%3d'rotate(120%2060%2c60)'%2f%3e%3cuse%20xlink%3ahref%3d'%23l'%20opacity%3d'.27'%20transform%3d'rotate(150%2060%2c60)'%2f%3e%3cuse%20xlink%3ahref%3d'%23l'%20opacity%3d'.37'%20transform%3d'r |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='UTF-8'/> | |
<title></title> | |
</head> | |
<body> | |
<div id='main'></div> | |
<script data-main='js/main.js' src='js/require.js'></script> | |
</body> |