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 'memcache' | |
require 'memcached' | |
require 'rufus/tokyo' | |
require 'tokyocabinet' | |
tc = TokyoCabinet::HDB.new('tc.tch') | |
tffi = Rufus::Tokyo::Cabinet.new('tffi.tch') | |
mc = Memcached.new "localhost:11211" | |
mr = MemCache.new "localhost:11211" |
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
# Ramaze Cucumber | |
require 'ramaze' | |
require 'webrat' | |
require 'ramaze/spec/bacon' | |
require File.join(File.dirname(__FILE__), *%w[.. .. start.rb]) | |
def app; Ramaze.middleware; end | |
Ramaze.setup_dependencies | |
Webrat.configure do |config| |
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
Section "ServerLayout" | |
# PS/2 Mouse not detected | |
# Serial Mouse not detected | |
Identifier "Xorg Configured" | |
Screen 0 "Screen0" 0 0 | |
InputDevice "Keyboard0" "CoreKeyboard" | |
InputDevice "USB Mouse" "CorePointer" | |
# Option "AIGLX" "on" | |
EndSection |
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
# | |
# Return UTM Zone for a geom | |
# | |
# Return Integer | |
def utm_zone | |
geomgeog = srid == 4326 ? self[get_column_name] : transform(4326) | |
puts geomgeog.class | |
geom = case geomgeog.class.to_s | |
when /Point/ then geomgeog | |
when /LineString/ then geomgeog.first |
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 Git Archlinux PKGBUILD | |
# Contributor: nofxx <[email protected]> | |
pkgname=ruby-git | |
pkgver=20081228 | |
pkgrel=1 | |
pkgdesc="A dynamic, open source programming language with a focus on simplicity and productivity." | |
arch=(i686 x86_64) | |
url="http://www.ruby-lang.org/en/" | |
license="Ruby" | |
depends=('glibc' 'gdbm' 'db' 'openssl' 'zlib' 'readline') |
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
# Copyright (c) 2008 Nicholas A. Evans | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: | |
# |
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
# # | |
# CAPISTRANO 2.5.0 DEPLOY | |
# GIT, Passenger, BackgrounDRB, Juggernaut | |
# | |
# Workflow: | |
# cap <stage> <task> | |
# cap <stage> deploy:setup | |
# cap <stage> deploy:cold | |
# . . . | |
# cap <stage> deploy |
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
Autotest.add_hook :initialize do |at| | |
at.clear_mappings | |
at.add_mapping(%r{^spec/.+_spec\.rb$}) do |filename,_| | |
filename | |
end | |
at.add_mapping(%r{^lib/< project folder!! >/(.+)\.rb$}) do |_,match| | |
[ "spec/< project folder!!!! >/#{match[1]}_spec.rb" ] + | |
at.files_matching(%r{^spec/integration/.+_spec\.rb$}) |
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 SubtitleIt | |
module Sub2Srt | |
def Sub2Srt.convert(filename) | |
framerate = 23.976 | |
infile = File.open(filename,'r') | |
read_mode = 0 | |
for line in inn do |line| | |
line.strip! |
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 Compile | |
def self.c | |
system "ruby ext/extconf.rb && cd ext && make" | |
end | |
end | |
class Autotest | |
Autotest.add_hook :ran_command do |a| | |
Compile::c | |
end | |
end |