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
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
- 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
# 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 ['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
/*! gist.github.com/4512971 | (c) 2013 Peter T Bosse II | Apache license */ | |
/*! Portions from: jqtouch.com | (c) 2009-2013 Sencha Labs | MIT license */ | |
/*jshint camelcase:true, curly:true, eqeqeq:true, quotmark:single, unused:true, laxbreak:false, onevar:true, latedef:true, trailing:true, indent:2, white:true, strict:true, browser:true, devel:true, jquery:true, prototypejs:true, undef:true */ | |
(function () { | |
'use strict'; | |
function iPod() { | |
return (/iP(hone|od)/.test(navigator.platform)); | |
} |
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
/*! gist.github.com/4494626 | (c) 2013 Peter T Bosse II | Apache license */ | |
/*jshint camelcase:true, curly:true, eqeqeq:true, quotmark:single, unused:true, laxbreak:false, onevar:true, latedef:true, trailing:true, indent:2, white:true, strict:true, browser:true, devel:true, jquery:true, prototypejs:true, undef:true */ | |
(function () { | |
'use strict'; | |
// Inspired by: <http://www.apress.com/9781430230458> | |
// Beginning iPhone & iPad Web Apps: Scripting with HTML5, CSS3, & JS | |
// Chapter 4: Pages 85-86: Hiding Mobile Safari's Address Bar |
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
var iOSversion = function() { | |
if (/iP(hone|od|ad)/.test(navigator.platform)) { | |
// supports iOS 2.0 and later: <http://bit.ly/TJjs1V> | |
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); | |
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)]; | |
} | |
}; |
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
#include <LiquidCrystal.h> | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
String one = "Target Temp"; | |
String two = "Current Temp"; | |
byte degreesf[8] = { | |
0b11000, | |
0b11000, |
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/sh |