Skip to content

Instantly share code, notes, and snippets.

View levycarneiro's full-sized avatar

Levy Carneiro Jr. levycarneiro

View GitHub Profile
#!/usr/bin/env ruby
#
# Brute-force way to retrieve all Github's repositories at once
# Usage:
# github_repos.rb clone # will clone all the user's repositories
# github_repos.rb clone test # will just clone 6 repositories for testing purposes
# github_repos.rb pull # will update all of the user's local repositories
#
# If you have forked repositories, the original sources will be added
# as remotes with the default 'forked_from' name, and a new 'forked_from'
function send_request ($request)
{
$server = $request['server'];
$path = $request['path'];
$verb = $request['verb'];
$content = $request['content'];
$headers = $request['headers'];
if (is_array($headers)) $additional_headers = join("\n", $headers) . "\n";
/*
* TypeHelpers version 1.0
* Zoltan Hawryluk, Nov 24 2009.
* @see http://www.useragentman.com/blog/2009/11/29/how-to-detect-font-smoothing-using-javascript/
*
* Released under the MIT License. http://www.opensource.org/licenses/mit-license.php
*
* Works for
* - IE6+ (Windows),
* - Firefox 3.5+ (Windows, Mac, Linux),
@levycarneiro
levycarneiro / license
Created January 27, 2010 10:55 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
year=`date "+%Y"`
cat <<EOF
Copyright (c) $year Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
#!/usr/bin/env ruby
#
# Put this script in your PATH and download from onemanga.com like this:
# onemanga_downloader.rb Bleach [chapter number]
#
# You will find the downloaded chapters under /tmp/Bleach
#
require 'rubygems'
require 'mechanize'
require 'nokogiri'
require 'rubygems'
require 'httparty'
require 'time'
require 'active_support'
File.read("#{ENV['HOME']}/.gitconfig").match(/token = (\w+)/)
TOKEN = $1
class Github
include HTTParty
# Gems for Ruby 1.9.1
gem install rails rails-sqlserver-2000-2005-adapter acts_as_tree acts_as_versioned activerecord-tableless annotate capistrano erubis haml haml-edge inherited_resources nifty-generators rack rack-cache racksh sqlite3-ruby will_paginate passenger
gem install cucumber rspec rspec-rails shoulda test-spec ZenTest autotest-fsevent autotest-growl autotest_screen email_spec factory_girl faker fakeweb log4r metric_fu mocha quietbacktrace rcov integrity webrat Selenium tarantula mash wirble hirb ruby2ruby RubyInline
gem install authlogic authlogic-oid bundler closure-compiler coderay compass cs-active_form dry_scaffold feed-normalizer formtastic has_scope hobo htmlentities validatable liquid newrelic_rpm paperclip responders searchlogic settingslogic thin tlsmail unicorn yui-compressor jammit lockdown
gem install BlueCloth lesstile markaby rdiscount RedCloth nokogiri libxml-ruby hpricot httparty httpclient mechanize rest-client xml-simple restfulie feedzirra prawn rss-client soap4r xmpp4r xm
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
class Comment
include MongoMapper::EmbeddedDocument
include Gravatarable
key :name, String
key :email, String
key :url, String
key :body, String
key :created_at, Time