Skip to content

Instantly share code, notes, and snippets.

View benaskins's full-sized avatar
🍑
Peachy

Ben Askins benaskins

🍑
Peachy
View GitHub Profile
(function($) {
$.fn.extend({
pluginName: function(options) {
// Initialise the class
new PluginClass(this, $.extend({}, $.fn.pluginName.defaults, options));
// Return this for chaining
return this;
}
});
~/Development/client_projects/thinkbank (master)$ irb
irb(main):001:0> my_klass = Struct.new(:x, :y)
=> #<Class:0x11605ac>
irb(main):003:0> my_object = my_klass.new(1, 2)
=> #<struct #<Class:0x11605ac> x=1, y=2>
irb(main):004:0> irb my_object
irb#1(#<struct #<Class:0x11605ac> x=1, y=2>):001:0> x
=> 1
irb#1(#<struct #<Class:0x11605ac> x=1, y=2>):002:0> y
=> 2
function GAImporter() {
this.busy = false;
this.poller = setInterval(this.pollJob, 5000);
this.pollJob = function() {
if (!this.busy) {
this.busy = true;
this.checkJob();
this.busy = false;
}
TypeError in Admin/stylesheetsController#create
can't modify frozen hash
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/attribute_methods.rb:313:in `[]='
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/attribute_methods.rb:313:in `write_attribute_without_dirty'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/dirty.rb:139:in `write_attribute'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/timestamp.rb:33:in `touch'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/association_proxy.rb:221:in `send'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/association_proxy.rb:221:in `method_missing'
stab.filter.modulate & stab.delay.on
(0..119).each do |bar|
(1..16).each do |measure|
kick.play if [1,5,9,13].include? measure
hat.play if [3,7,11,15].include? measure
clap.play if [5,13].include? measure
stab.play if measure == 1 && bar % 4 == 0
sleep 0.03125
end
bassline.repeat
Rails 2.3.3
===========
ab -n 10 -c 5 http://weather1.staging.wxinabox.local/search/2250
Complete requests: 10
Failed requests: 9
With patch http://tinyurl.com/kwzyrj reverted
class ApplicationController < ActionController::Base
before_filter :set_current_site
protected
def set_current_site
@current_site = Site.find_by_domain_name(request.domain)
end
end
desc "Pre-fetch data from the webservice to avoid calling in line"
task :prefetch => [:environment, :preload_resources] do
UserLocality.all.collect { |ul| ul.locality }.uniq.each do |locality|
Rails.cache.fetch("location:#{locality.wz_location_code}", :expires_in => 10.minutes) do
locality.weather_location
end
end
end
%li
%h3
%fb:userlink{:uid => friend.fb_user_id}
%em= friend.locality.name
.weather
%fb:profile-pic{:uid => friend.fb_user_id, :linked => true}
%span.icon= forecast_icon(friend.forecast.icon_name)
%span.current
= v friend.location.current_conditions, :temp_c
%br/
namespace :facebooker do
tunnel_ns = namespace :tunnel do
# Courtesy of Christopher Haupt
# http://www.BuildingWebApps.com
# http://www.LearningRails.com
desc "Create a reverse ssh tunnel from a public server to a private development server."
task :start => [ :environment, :config ] do
puts @notification
system @ssh_command