HTML Building:
- Forms:
- Forme: Great simple form building
- HTML
- Tiny: Framework agnostic markup builder, useful for defining view helpers or as a micro templating dsl, plays nice with erb and haml (Examples: http://forme.heroku.com/)
## gem install dropbox-api | |
##### Dropbox | |
require 'dropbox-api' | |
## for client config: | |
## create Rakefile | |
>require "dropbox-api/tasks" | |
>Dropbox::API::Tasks.install | |
## execute: rake dropbox:authorize | |
Dropbox::API::Config.app_key = YOUR_API_KEY |
require 'dbm' | |
require 'github_api' | |
class Cache | |
attr_accessor :db | |
def initialize | |
@db = DBM.open('starred', 666, DBM::WRCREAT) | |
end | |
def load(key) |
HTML Building:
Total: 96 samples | |
14 14.9% 14.9% 15 16.0% Kernel#require_without_backports | |
12 12.8% 27.7% 12 12.8% garbage_collector | |
10 10.6% 38.3% 10 10.6% Hash#[]= | |
7 7.4% 45.7% 42 44.7% Kernel#gem_original_require | |
6 6.4% 52.1% 6 6.4% File.file? | |
5 5.3% 57.4% 5 5.3% File.read | |
4 4.3% 61.7% 4 4.3% Hash.[] | |
4 4.3% 66.0% 4 4.3% Module#module_eval | |
3 3.2% 69.1% 5 5.3% Module#defentity |
# encoding : utf-8 | |
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'digest/sha1' | |
require 'base64' | |
require 'date' | |
require 'uri' | |
class S3; end | |
class << S3 |
#!/usr/bin/env ruby | |
require 'twitter' | |
require 'dbm' | |
# https://dev.twitter.com/apps | |
# https://dev.twitter.com/apps/{some_id}/show -> (OAuth settings + Your access token) | |
CONSUMER_KEY = "_" | |
CONSUMER_SECRET = "_" | |
OAUTH_TOKEN = "_" |
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
url = "http://rss.dw.de/xml/DKpodcast_audiotrainer_de" | |
filename = "DKpodcast_audiotrainer_de" | |
unless File.exists?(filename) | |
`wget #{url}` |
### install qpress from here: http://www.quicklz.com/ | |
# wget http://www.quicklz.com/qpress-11-linux-x64.tar | |
# tar xvf qpress-11-linux-x64.tar | |
## switch nc to traditional on ubuntu: | |
>sudo update-alternatives --config nc | |
There are 2 choices for the alternative nc (providing /bin/nc). | |
Selection Path Priority Status | |
------------------------------------------------------------ |
# gem install contacts | |
# >> remove "require 'jcode' " in gdata gem, if on ruby 1.9 | |
require 'rubygems' | |
require 'contacts' | |
CONTACTS_SCOPE = 'http://www.google.com/m8/feeds/' | |
CONTACTS_FEED = CONTACTS_SCOPE + 'contacts/default/full/?max-results=1000' | |
@client = GData::Client::Contacts.new |
sudo rm -rf /Library/LaunchDaemons/homebrew.mxcl.mongodb.plist sudo cp /usr/local/Cellar/opt/mongodb/homebrew.mxcl.mongodb.plist /Library/LaunchDaemons/homebrew.mxcl.mongodb.plist sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.mongodb.plist sudo launchctl start homebrew.mxcl.mongodb