This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
# db/migrations/your_migration | |
class AddPositionToAsset < ActiveRecord::Migration | |
def change | |
add_column :assets, :position, :integer | |
end | |
end |
#app/views/shared/_addthis.haml | |
.addthis_toolbox.addthis_default_style | |
-# %a.addthis_button_vk | |
-# %i.icon-vkontakte | |
-# %a.addthis_button_facebook | |
-# %i.icon-facebook-sign | |
-# %a.addthis_button_google_plusone_share | |
-# %i.icon-google_oauth2-sign | |
-# %a.addthis_button_twitter |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var width = 960, | |
height = 500; | |
var nodes = d3.range(200).map(function() { return {radius: Math.random() * 12 + 4}; }), |
This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
config.middleware.insert_after(::Rack::Runtime, "::Rack::Auth::Basic", "Staging") do |u, p| | |
[u, p] == ['username', 'password'] | |
end |
format_phone = (phone, convert, trim) -> | |
convert = true if typeof convert is "undefined" | |
trim = true if typeof trim is "undefined" | |
# Strip out any extra characters that we do not need only keep letters and numbers | |
phone = phone.replace(/[^0-9A-Za-z]/, "") | |
# Do we want to convert phone numbers with letters to their number equivalent? | |
if convert is true and phone.match(/[a-zA-Z]/) | |
replace = |
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
angular.module('module').factory "Sound", () -> | |
class Sound | |
constructor: ()-> | |
@context = new webkitAudioContext() | |
@cache = {} | |
@request = new XMLHttpRequest() | |
@request.responseType = "arraybuffer" |
var list = Array.apply(null, { length: 100 }).map(Number.call, Number).map(function (i) { | |
return callback(i); | |
}); |
def fib(n): | |
a, b = 0, 1 | |
while a < n: | |
print(a) | |
a, b = b, a+b |