Some CoffeeScript (verbosely commented for clarity)
# Override Rails handling of confirmation
$.rails.allowAction = (element) ->
# The message is something like "Are you sure?"
message = element.data('confirm')
# Pow | |
alias startpow='curl get.pow.cx | sh' | |
alias stoppow='curl get.pow.cx/uninstall.sh | sh' |
class PostsController < ApplicationController | |
inherit_resources | |
protected | |
def begin_of_association_chain | |
Agency.find_by_code request.subdomains.first | |
end | |
end |
// Add classes to <html> for responsive layouts - | |
// e.g. <html class="over320 over480 under768 under960"> | |
jQuery(function() { | |
var widths = [ 320, 480, 768, 960 ]; | |
var setWidthClasses = function() { | |
var w = $(window).width(); | |
for(var i=0; i<widths.length; i++) { | |
$('html').removeClass('under' + widths[i]).removeClass('over' + widths[i]); | |
} |
Language.create!(name: 'English (US)', code: 'en', locale: 'en-US') if Language.count == 0 | |
if Administrator.count == 0 | |
admin = Administrator.new( | |
first_name: 'Super', | |
last_name: 'Admin', | |
email: '[email protected]', | |
password: 'adminpass', | |
password_confirmation: 'adminpass' | |
) |
function longestCommonPrefix(arr) { | |
var prefix = ''; | |
var firstWord = arr[0]; | |
function inAll(letter, idx) { | |
for(var j=0; j<arr.length; j++) { | |
if(arr[j][idx] != letter) return false; | |
} | |
return true; | |
} |
<!-- | |
PIE: CSS3 rendering for IE | |
Version 1.0.0 | |
http://css3pie.com | |
Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. | |
--> | |
<PUBLIC:COMPONENT lightWeight="true"> | |
<!-- saved from url=(0014)about:internet --> | |
<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" /> | |
<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" /> |
sanitizeForDomID = (str) -> | |
chars = | |
"ä": "ae" | |
"ö": "oe" | |
"ß": "ss" | |
"ü": "ue" | |
"æ": "ae" | |
"ø": "oe" | |
"å": "aa" | |
"é": "e" |
var Plan = (function() { | |
// protected | |
var records = []; | |
// the Plan constructor | |
function Plan(key, id, price) { | |
this.id = id; | |
this.price = price; | |
var more = key.split('||'); |
#!/usr/bin/env ruby | |
require 'fog' | |
require 'open-uri' | |
class BrandsmithDNS | |
def initialize | |
@dns = Fog::DNS.new(:provider => 'rackspace', :rackspace_api_key => 'xxxxxxxxxxxxxxxxxx', :rackspace_username => 'yyyyyyyyyyyyyyyyyy') | |
@record = @dns.zones.get('11111111').records.get('A-222222222') | |
end |