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
<script type="text/javascript"> | |
(function(e,t,n){var r,a,c="script";e.gigwell=e.gigwell||{},r=t.createElement(c), | |
a=t.getElementsByTagName(c)[0],r.async=1,r.src=n,a.parentNode.insertBefore(r,a) | |
})(window,document,'https://static.bookongigwell.com/booking-widget.min.js'); | |
gigwell.agencyId = 'x81998c8j812'; // Required | |
gigwell.artistId = '821x988122d'; // Optional | |
// optional |
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
// Inspired (stolen?) from JQuery (https://github.com/jquery/jquery/blob/1.3.2/src/ajax.js#L264) | |
// and http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/ | |
function loadJS(url, callback){ | |
var head = document.getElementsByTagName("head")[0]; | |
var script = document.createElement("script"); | |
script.src = url; | |
script.async = true; | |
// Attach handlers for all browsers | |
script.onload = script.onreadystatechange = function(){ |
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
// Example take from the book Java Application Design (http://www.bevacqua.io/buildfirst) | |
// https://github.com/buildfirst/buildfirst/blob/master/ch05/06_prototypal-modularity/protolib.js | |
// Still using an IIFE to expose the library! | |
(function(window){ | |
// use these to sign each instance and access its private scope | |
var lastId = 0; | |
var data = {}; | |
function Lib () { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 crypto = require('crypto'); | |
crypto.randomBytes(16).toString('hex'); | |
// 'e834ba2133229fb78a693f5ca3ae05de' |
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
// The limited unauthenticated routemap | |
var authRoutes = { | |
'/signup' : modules.signup, | |
'/login' : modules.login | |
}; | |
// The whole shebang | |
var appRoutes = Object.assign( { | |
'/:semantic/:app/:routes' : various.modules | |
}, authRoutes ); |
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
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.plural /([aeiou])([A-Z]|_|$)/, '\1s\2' | |
inflect.plural /([rlnd])([A-Z]|_|$)/, '\1es\2' | |
inflect.plural /([aeiou])([A-Z]|_|$)([a-z]+)([rlnd])($)/, '\1s\2\3\4es\5' | |
inflect.plural /([rlnd])([A-Z]|_|$)([a-z]+)([aeiou])($)/, '\1es\2\3\4s\5' | |
inflect.singular /([aeiou])s([A-Z]|_|$)/, '\1\2' | |
inflect.singular /([rlnd])es([A-Z]|_|$)/, '\1\2' | |
inflect.singular /([aeiou])s([A-Z]|_)([a-z]+)([rlnd])es($)/, '\1\2\3\4\5' | |
inflect.singular /([rlnd])es([A-Z]|_)([a-z]+)([aeiou])s($)/, '\1\2\3\4\5' |
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
group :test do | |
gem 'rspec-rails' | |
gem 'database_cleaner' | |
gem 'factory_girl_rails', '~> 1.2' | |
gem 'capybara' | |
end | |
# For support simple_form 2 use: | |
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git' |
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
# in config/env.yml | |
defaults: &defaults | |
ENV_YAML: true | |
development: | |
<<: *defaults | |
test: | |
<<: *defaults |
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
<h1 id="qunit-header">Unit Tests</h1> | |
<h2 id="qunit-banner"></h2> | |
<div id="qunit-testrunner-toolbar"></div> | |
<ol id="qunit-tests"></ol> | |
<div id="qunit-fixture"></div> |
OlderNewer