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 | |
# $File: apache_status_parser.rb $ | |
# Created by Vitalie Lazu on Mon, 05 Nov 2007 20:28:57 +0200 | |
# Using hpricot to parse apache server status and kill processes that takes too much time to complete | |
# | |
# Debian/Ubuntu setup: | |
# apt-get install rubygems | |
# gem install hpricot --no-ri --no-rdoc | |
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 'rubygems' | |
require 'roo' | |
s = Excel.new("price-dd.xls") | |
s.default_sheet = s.sheets.first | |
#puts s.info | |
i = s.first_row |
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 | |
require 'net/http' | |
require 'optparse' | |
require 'timeout' | |
require 'cgi' | |
# Source: http://pastie.org/98642 | |
# Post code for review |
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
# Author: Vitalie Lazu | |
# Date: Mon, 01 Dec 2008 14:28:28 +0200 | |
# Rake tasks to help you with family photos: | |
# * Download photos from camera | |
# * Arrange photos in folders by date like digikam, | |
# * Rotate them according exif information | |
# | |
# Setup to use this tasks: | |
# apt-get install rubygems imagemagick gphoto2 rake |
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 | |
# | |
# Author: Vitalie Lazu <[email protected]> | |
# Date: Sat, 10 Jan 2009 19:12:43 +0200 | |
# | |
# CLI ruby client for Tracks: rails application for GTD methodology | |
# http://www.getontracks.org/development/ | |
# You need to set ENV['GTD_LOGIN'], ENV['GTD_PASSWORD'] |
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
link_to_remote("Post a comment", :update => "wiki-comment-form", :url => {:action => "show_add_comment", :id => @space, :wiki_id => @wiki_version}, | |
:before => visual_effect(:appear, "load_dots", :queue => 'end'), | |
:complete => visual_effect(:fade, "load_dots") + visual_effect(:fade, 'flows-w') + visual_effect(:appear, 'wiki-comment-form', :queue => 'end')) | |
encodeURIComponent(location.href) | |
Form.getInputs(form, 'radio', name).each(function(input) { | |
if (input.value == value) { | |
input.checked = true |
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
# | |
# Helper tasks to build debian packages from git repository | |
# | |
# apt-get install git-buildpackage | |
# Create local branches | |
# $ rake deb:setup | |
# create a snapshot | |
# $ rake snap | |
branch = "snapshot" |
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
# replace string in files recursively. | |
# author: Vitalie Lazu | |
s = ARGV[0] | |
r = ARGV[1] | |
FILES = /\.(rb|erb|rhtml|rake|yml|rjs|rxml)$/ | |
def suggest_bak(file) | |
bak = "#{file}~" |
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
# build server role map | |
task :test_me, :roles => :web do |t| | |
srv_roles = {} | |
for role, values in t.roles | |
values.map do |s| | |
srv_roles[s.host] ||= [] | |
srv_roles[s.host] << role | |
end | |
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
# add chars at beginning, last should be \\ | |
BAD_URL_CHARS = "<>\"'\r\n #:/&;,%.=?\\" | |
# This id will be used in links | |
def to_param | |
if new_record? | |
"new-milestone" | |
else | |
"#{id}-#{title.tr(BAD_URL_CHARS, "-")}" | |
end |
OlderNewer