This file contains 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
#!/bin/bash | |
# Usage: OAUTH_TOKEN="..." backfill-releases CHANGELOG.md [<project-title>] | |
set -e | |
log="${1?}" | |
project_name="${2}" | |
repo="$(git config remote.origin.url | grep -oE 'github\.com[/:][^/]+/[^/]+' | sed 's/\.git$//' | cut -d/ -f2-3)" | |
[ -n "${project_name}" ] || project_name="${repo#*/}" |
This file contains 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
ruby-2.0.0-p353 |
This file contains 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
module ObjectSpace | |
def self.profile(&blk) | |
require 'objspace' | |
enable_gc = GC.disable | |
ObjectSpace.trace_object_allocations(&blk) | |
objs = Hash.new(0) | |
ObjectSpace.each_object { |o| | |
if (file = ObjectSpace.allocation_sourcefile(o)) && (line = ObjectSpace.allocation_sourceline(o)) | |
objs["#{file}:#{line}:#{o.class.name}"] += 1 |
This file contains 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 "benchmark/ips" | |
File.write "minitest_test.rb", <<-EOS | |
require "minitest/autorun" | |
require "minitest/pride" | |
class MintestTest < Minitest::Test | |
def test_foo | |
assert true | |
end |
This file contains 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
source "https://rubygems.org" | |
gem "minitest" | |
gem "rspec" |
This file contains 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 'rspec' | |
require 'rspec/autorun' | |
require 'nokogiri' | |
class SomeClass | |
def example(doc); end | |
end | |
# Warning: running this _will_ freeze your computer or at the very least make it | |
# very slow, consume a lot of CPU and burn your lap (in case you're using a |
This file contains 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 'sinatra' | |
require 'json' | |
require 'addressable/uri' | |
require File.expand_path('rack_stereoscope.rb', File.dirname(__FILE__)) | |
configure do | |
use Rack::Reloader; | |
use Rack::Lint; | |
use Rack::Stereoscope; | |
end |
This file contains 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
$ ruby --version | |
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0] | |
$ ruby yaml_bug.rb | |
YAML modifies strings when it serializes them! | |
Original: "1\n \n2" | |
Modified: "1\n\n2" |
This file contains 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 'spec_helper' | |
describe "Registration" do | |
before(:all) do | |
FakeWeb.allow_net_connect = true | |
end | |
after(:all) do | |
FakeWeb.allow_net_connect = false |
This file contains 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
# encoding: iso8859-1 | |
require 'yaml' | |
x = "Antonio Giménez Muñoz" | |
x.force_encoding('BINARY') | |
p x.encode('UTF-8') |
OlderNewer