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 python | |
# -*- coding: UTF-8 -*- | |
# Sends a bunch of links to delicious. | |
# | |
# This script depends on pydelicious library, which can be found here: | |
# http://code.google.com/p/pydelicious/ | |
# | |
# Command-line usage: | |
# | |
# delicious_send.py <username> <password> <file with links> [file2, file3, ... ] |
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 9a41f1f8b7ce073302e864cd71901c0628d818be Mon Sep 17 00:00:00 2001 | |
From: Kiyoshi de Brito Murata <13k@kside.net> | |
Date: Mon, 9 Feb 2009 05:03:32 -0200 | |
Subject: [PATCH] Horizontal size and alignment | |
--- | |
data/guake.schemas | 32 +++++- | |
data/prefs.glade | 274 ++++++++++++++++++++++++++++++++-------------- | |
src/guake.py | 92 +++++++++++----- | |
src/guake_globals.py.in | 3 + |
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
class Array | |
def slices(*args) | |
args.map do |arg| | |
case arg | |
when Range, Fixnum | |
self[arg] | |
else | |
raise ArgumentError, "Arguments for slices() must be either Fixnum or Range" | |
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
#!/bin/sh | |
# Pushes current branch to remote branch possibly with different names | |
# With no arguments, pushes to origin +<branch>:<branch> where <branch> | |
# is the same branch name as current. | |
# With one argument, pushes to origin +<branch>:<argument> | |
head=`git symbolic-ref HEAD` | |
branch=`basename $head` | |
git push origin +$branch:${1:-$branch} |
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
#!/bin/sh | |
# | |
# Identifies the predominant color in an image. | |
# You can specify certain colors to discard from the result. | |
# | |
# Usage: $0 <image> [colors to discard] | |
[ -z "$1" ] && exit 1 | |
file="$1" |
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
def Object.method_added(method) | |
return super(method) unless method == :helper | |
helper.instance_variable_set("@controller", app) | |
def helper.method_missing(method, *args, &block) | |
helper.send(method, *args, &block) if helper.instance_variable_get('@controller') && method.to_s =~ /_path$|_url$/ | |
end | |
end if ENV['RAILS_ENV'] |
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
# | |
# "grep"s through Rails views searching for a specific Route. | |
# | |
# You can think of it as a "which views links to this route" finder, | |
# good in refactoring scenarios. | |
# | |
# Actually the search is done using "ack" [http://betterthangrep.com], | |
# you must have it in your PATH. | |
# | |
# Also, this ack usage requires a definition of the Haml filetype for |
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
--type-set | |
haml=.haml |
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 'rexml/parsers/pullparser' | |
require 'htmlentities' | |
class String | |
# Truncate strings containing HTML code | |
# Usage example: "string".truncate_html(50, :word_cut => false, :tail => '[+]') | |
def truncate_html(len = 30, opts = {}) | |
opts = {:word_cut => true, :tail => ' ...'}.merge(opts) | |
p = REXML::Parsers::PullParser.new(self) | |
tags = [] |
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
" | |
" CSS 1-line comment helpers | |
" | |
" Comments the current line | |
fun CssComment() | |
:s@^\(\s*\)\(.*\)$@\1/*\2*/@ | |
endfun | |
" Un-comment from current line |
OlderNewer