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
$('ul.tab-controls li').bind('click', function() { | |
$(this).addClass('active').siblings().removeClass('active') | |
.parents('#funbox').find('ul.tab').hide().eq($(this).index()).fadeIn(500); | |
return false; | |
}); | |
// HTML: | |
// <div id="funbox"> | |
// <ul class="tab-controls"> | |
// <li class="active"><a href="#">Featured</a></li> |
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
/*! | |
* jQuery TwitCharCounter Plugin | |
* version: 1.0 (10-MAR-2011) | |
* created by: PavelTyk | |
* | |
* This is a simple char counter plugin (like the Twitter one). It has flexible | |
* settings and allows minimize configuration settings. | |
* | |
* Examples and documentation at: https://gist.github.com/863967 |
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
letters = 'satire' | |
dictionary = {} | |
results = [] | |
File.open("/usr/share/dict/words", "r") do |infile| | |
while line = infile.gets | |
word = line.chomp.downcase | |
next if word.size != 7 | |
key = word.chars.sort.join |
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
output_file = File.open 'activemerchant_gateway_output.rb', 'w' | |
output_file.puts "PAYMENT_GATEWAYS = {" | |
File.open 'activemerchant_gateway_input.txt' do |input_file| | |
input_file.each_line do |line| | |
match = line.match /^.*?(\w*).rb:.*class (\w*)Gateway.*$/ | |
next unless match | |
output_file.puts " \"#{match[1]}\" => {" | |
output_file.puts " :name => \"#{match[2]}\"," | |
output_file.puts " :class => ActiveMerchant::Billing::#{match[2]}Gateway" | |
output_file.puts " }," |
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
output_file = File.open 'gem_remote_output.txt', 'w' | |
File.open 'gem_remote_input.txt' do |input_file| | |
input_file.each_line do |line| | |
match = line.match /^([^_\-][\-\w\.]*) \(([\d\.]*).*\)$/ | |
output_file.puts "gem install #{match[1]} -v #{match[2]}" if match | |
end | |
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
# Mail Chimp Test Task | |
API_KEY = 'api-key' | |
LIST_NAME = 'list name' | |
require 'rubygems' | |
require 'xmlrpc/client' | |
require 'active_record' | |
# === Database Setup |
NewerOlder