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
| Minstrel: 1 | |
| Bard: 1 | |
| Troubadour: 1 | |
| Jongleur: 1 |
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
| test gist |
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
| ########################################################################## | |
| # This is now a proper Github project: http://github.com/klondike/wesabe | |
| ########################################################################## | |
| wesabe = Wesabe.new 'username', 'password' | |
| # login to trigger automatic updates, so your account info will be fresh | |
| wesabe.trigger_updates | |
| # fetch your account data (you may want to wait a minute after triggering updates) |
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
| class User < ActiveRecord::Base | |
| has_attached_file :avatar, :styles => {:thumb => '100x100>'} | |
| end | |
| ########### | |
| class CreateUsers < ActiveRecord::Migration | |
| def self.up | |
| create_table :users do |t| | |
| t.string :avatar_file_name |
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
| require 'rubygems' | |
| require 'wirble' | |
| Wirble.init | |
| Wirble.colorize | |
| # if I'm in a Rails app | |
| require 'test/factories' if File.exists?('test/factories.rb') | |
| require 'congrelate' if File.exists?('congrelate.rb') |
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
| require 'net/https' | |
| require 'rexml/document' | |
| require 'yaml' | |
| CERT_FILENAME = File.dirname(__FILE__) + "/cacert.pem" | |
| class Wesabe | |
| attr_accessor :email, :password, :accounts, :account_xml, :http | |
| def initialize(file) |
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
| # Put it in your .irbrc, then you can see the methods of an object or class, besides the ones Object gives to everyone. | |
| def m(obj) | |
| if obj.is_a? Class | |
| obj.methods.sort - Object.methods | |
| else | |
| obj.methods.sort - Object.new.methods | |
| 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
| protected class TweetAdapter extends BaseAdapter { | |
| private Activity context; | |
| private Status[] tweets; | |
| LayoutInflater inflater; | |
| public TweetAdapter(Activity c, Status[] tw) { | |
| context = c; | |
| tweets = tw; | |
| inflater = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
| } |
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
| final Handler handler = new Handler(); | |
| final Runnable updateThread = new Runnable() { | |
| public void run() { | |
| ImageView picture = (ImageView) LegislatorProfile.this.findViewById(R.id.picture); | |
| picture.setImageDrawable(avatar); | |
| } | |
| }; | |
| public void loadImage() { | |
| Thread loadingThread = new Thread() { |
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
| # This is now n actual repo, here: | |
| # http://github.com/klondike/muine-osd | |
| #!/usr/bin/env ruby | |
| require 'yaml' | |
| def d(string); string.gsub /[\'\"]/, ''; end | |
| def load_song(details) | |
| song = {} | |
| details.split(/[\n\r]+/).each do |line| |
OlderNewer