Skip to content

Instantly share code, notes, and snippets.

View shingara's full-sized avatar

Cyril Mougel shingara

  • regate.io
  • Pau ( France )
View GitHub Profile
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
@shingara
shingara / gist:214674
Created October 20, 2009 22:18
cron check all Integrity project and launch build if needed avoid callback from source
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")
[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
# 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"
gem 'mongo_mapper'
require 'mongo_mapper'
MongoMapper.database = 'benchmarking'
class Foo
include MongoMapper::Document
key :approved, Boolean
key :count, Integer
key :approved_at, Time
module UniqueName
validates_uniqueness_of :name
end
class User < AR
include UniqueName
end
class Person < AR
include UniqueName
#!/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,
#!/usr/bin/ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/opt/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
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 {
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",