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/http' | |
require 'uri' | |
""" | |
@authors : Cyril Mougel <[email protected]> | |
@goal : This weechat's plugin send notification to open notification | |
account when you have been highlighted on a irc's channel or | |
when you received private message. | |
Just copy this script in your .weechat/ruby/autoload and set this | |
@licence : GPL v3. | |
@version : 0.2.0 |
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 'integrity' | |
Integrity.new(YAML.load_file('/var/rails/integrity/config.yml').merge({:log => '/var/rails/integrity/log/integrity-cron.log'})) | |
include Integrity | |
Project.all.each do |project| | |
unless project.last_commit | |
puts "build #{project.name}" | |
project.build("HEAD") | |
next | |
end | |
unless `git ls-remote #{project.uri}`.include?("#{project.last_commit.identifier}\tHEAD") |
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
[2009-11-18 14:15:04] $(rvm 1.8.7 ; rake) | |
/Users/Cyril/.rvm/ruby-1.8.7-p174/bin/ruby vm/codegen/field_extract.rb vm/builtin/object.hpp vm/builtin/integer.hpp vm/builtin/fixnum.hpp vm/builtin/array.hpp vm/builtin/bignum.hpp vm/builtin/executable.hpp vm/builtin/access_variable.hpp vm/builtin/block_environment.hpp vm/builtin/block_as_method.hpp vm/builtin/bytearray.hpp vm/builtin/io.hpp vm/builtin/channel.hpp vm/builtin/module.hpp vm/builtin/class.hpp vm/builtin/compiledmethod.hpp vm/builtin/data.hpp vm/builtin/dir.hpp vm/builtin/exception.hpp vm/builtin/float.hpp vm/builtin/immediates.hpp vm/builtin/iseq.hpp vm/builtin/list.hpp vm/builtin/lookuptable.hpp vm/builtin/memorypointer.hpp vm/builtin/methodtable.hpp vm/builtin/nativefunction.hpp vm/builtin/packed_object.hpp vm/builtin/regexp.hpp vm/builtin/selector.hpp vm/builtin/staticscope.hpp vm/builtin/sendsite.hpp vm/builtin/string.hpp vm/builtin/symbol.hpp vm/builtin/thread.hpp vm/builtin/tuple.hpp vm/builtin/compactlookuptable.hpp vm/builtin/time.hpp vm/builtin |
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
# mongo_template.rb | |
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842) | |
# fork of Kyle Banker's Rails MongoMapper Template (http://gist.github.com/219223) | |
# | |
# To use: | |
# change url by raw link in http://gist.github.com/242007 | |
# rails project_name -m http://gist.github.com/gists/242007.txt | |
# remove unneeded defaults | |
run "rm public/index.html" |
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
gem 'mongo_mapper' | |
require 'mongo_mapper' | |
MongoMapper.database = 'benchmarking' | |
class Foo | |
include MongoMapper::Document | |
key :approved, Boolean | |
key :count, Integer | |
key :approved_at, Time |
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
module UniqueName | |
validates_uniqueness_of :name | |
end | |
class User < AR | |
include UniqueName | |
end | |
class Person < AR | |
include UniqueName |
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
#!/usr/bin/perl | |
# AUTHOR: GPL(C) Mohsin Ahmed, http://www.cs.albany.edu/~mosh. | |
my $splitter = ' '; | |
$USAGE = " | |
USAGE: align options file > tabularfile | |
SYNOPSIS: Aligns the columns of file, | |
- Breaks lines into columns, COLUMNS = split( SPLITTER_REGEXP, LINE ) | |
- Determines the max column widths and printf FORMAT, |
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 'eventmachine' | |
require 'feedzirra' | |
feeds_url = [ "http://stackoverflow.com/feeds/tag/ruby-on-rails", | |
"http://stackoverflow.com/feeds/tag/ruby", | |
"http://stackoverflow.com/feeds/tag/git", | |
"http://stackoverflow.com/feeds/tag/mongodb", | |
"http://stackoverflow.com/feeds/tag/vim"] | |
EventMachine.run { |
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 'eventmachine' | |
require 'feedzirra' | |
require 'restclient' | |
feeds_url = [ "http://stackoverflow.com/feeds/tag/ruby-on-rails", | |
"http://stackoverflow.com/feeds/tag/ruby", | |
"http://stackoverflow.com/feeds/tag/git", | |
"http://stackoverflow.com/feeds/tag/mongodb", | |
"http://stackoverflow.com/feeds/tag/nginx", |