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
# http://www.pauldix.net/2008/08/serializing-dat.html | |
require 'benchmark' | |
require 'rubygems' | |
require 'json' | |
require 'yaml' | |
include Benchmark | |
benchmark_iterations = 1 | |
large_single_dimension_array = [42, 123.123] * 5000 |
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
#!/usr/bin/env ruby | |
# Jabber-SH — SH console via XMPP/Jabber (GTalk) | |
# | |
# Jabber-SH allows you to administrate a remote computer via a command line | |
# through a Jabber client. It’s like SSH via GoogleTalk! :) | |
# This is just a hack but it might be usefull sometime to run basic commands | |
# on a machine that is not accessible via ssh. | |
# | |
# Philippe Creux. pcreux/AT/gmail/DOT/com |
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
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically | |
// Example: | |
// $(document).ready(function() { | |
// ProvideHtml5.autofocus() | |
// ProvideHtml5.datepicker() | |
// ProvideHtml5.forcenumber() | |
// }) | |
var ProvideHtml5 = { | |
autofocus = function() { |
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
# from http://media.railscasts.com/videos/096_git_on_rails.mov | |
# empty directories | |
# $ touch tmp/.gitignore log/.gitignore vendor/.gitignore | |
#.gitignore | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml |
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
#!/usr/bin/env ruby | |
hache = {"A" => 3107227, "B" => 3814675 , "C" => 6639564 , "D" => 741901 , "E" => 7579381 , "F" => 4428177 , "G" => 3842022 } | |
sum = {} | |
hache.each { |name, size| | |
copy = hache.dup | |
copy.delete(name) | |
sum[name] =copy.values.inject {|x, y| x += y} | |
} |
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
#!/usr/bin/env ruby | |
class Grapher | |
class << self | |
Props = { | |
:branch => '[shape=box,style=filled,fillcolor="#ccffcc",color="#003300"]', | |
:commit => '[style=filled,fillcolor="#ffffcc",color="#663333"]', | |
:ref => '', | |
:relation => '[dir=back,color="#545443"]', |
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 Feedzirra | |
module Parser | |
class FlickrEntry | |
include SAXMachine | |
include FeedEntryUtilities | |
element :guid, :as => :id | |
element :title |
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
#!/usr/bin/env ruby | |
## WP2TUMBLR: WordPress 2 Tumblr Importing tool | |
## | |
## Usage: wp2tumblr [OPTION] WORDPRESS_XML_FILE | |
## | |
## Import the WORDPRESS_XML_FILE to a Tumblr blog. | |
## Provide `--group` option to publish to a group. | |
## This could take a long time... | |
## | |
## To install, download the script and chmod to 755. |
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
# include at least one source and the rails gem | |
source :gemcutter | |
gem 'rails', '~> 2.3.5', :require => nil | |
group :development do | |
# bundler requires these gems in development | |
gem 'rails-footnotes' | |
end | |
group :test do |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<schema name="basecamp" version="1.3"> | |
<types> | |
<!-- indexed/stored verbatim --> | |
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/> | |
<!-- "true" or "false" --> | |
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/> | |
<!-- binary data, base64 --> |
OlderNewer