Discover gists
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 -*- | |
""" mymixi_diary.py | |
マイミク+自分の日記をダウンロードする | |
""" | |
import os | |
import pickle | |
import re | |
import time |
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 eager_cache(trigger_action, target_action, conditions = {}) | |
if target_action.is_a? Array | |
target_controller, target_action = *target_action | |
conditions[:controller] = target_controller | |
end | |
after("_eager_cache_#{trigger_action}_after", conditions.only(:if, :unless).merge(:with => [conditions.except(:if, :unless)], :only => trigger_action)) | |
alias_method "_eager_cache_#{trigger_action}_after", :_eager_cache_after | |
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
puts "hello" |
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
# This gets mocha and bacon playing together, but there needs to be a hack in mocha as well | |
# See the open issue here: | |
# http://groups.google.com/group/mocha-developer/browse_thread/thread/2ac239561ef07b23 | |
require 'bacon' | |
require "mocha/standalone" | |
require "mocha/object" | |
class Bacon::Context | |
include Mocha::Standalone | |
def initialize(name, &block) |
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
puts "hello, goodbye!" |
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/c++ -bundle -headerpad_max_install_names -o qtruby4.so "CMakeFiles/qtruby4.dir/Qt.o" "CMakeFiles/qtruby4.dir/handlers.o" "CMakeFiles/qtruby4.dir/marshall_types.o" -L/Users/nicolas/Downloads/qt4-qtruby-1.4.10/smoke/qt -F/Library/Frameworks -framework QtCore -lpthread -lruby -F/Library/Frameworks -framework QtNetwork -lsmokeqt -F/Library/Frameworks -framework QtCore -lpthread -F/Library/Frameworks -framework QtGui -F/Library/Frameworks -framework QtNetwork -F/Library/Frameworks -framework QtOpenGL -F/Library/Frameworks -framework QtDBus -F/Library/Frameworks -framework QtSql -F/Library/Frameworks -framework QtSvg -lQtUiTools -F/Library/Frameworks -framework QtXml -F/Library/Frameworks -framework QtWebKit |
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/c++ -bundle -headerpad_max_install_names -o qtruby4.so "CMakeFiles/qtruby4.dir/Qt.o" "CMakeFiles/qtruby4.dir/handlers.o" "CMakeFiles/qtruby4.dir/marshall_types.o" -L/Users/nicolas/Downloads/qt4-qtruby-1.4.10/smoke/qt -F/Library/Frameworks -framework QtCore -lpthread -lruby -F/Library/Frameworks -framework QtNetwork -lsmokeqt -F/Library/Frameworks -framework QtCore -lpthread -F/Library/Frameworks -framework QtGui -F/Library/Frameworks -framework QtNetwork -F/Library/Frameworks -framework QtOpenGL -F/Library/Frameworks -framework QtDBus -F/Library/Frameworks -framework QtSql -F/Library/Frameworks -framework QtSvg -lQtUiTools -F/Library/Frameworks -framework QtXml -F/Library/Frameworks -framework QtWebKit |
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/ruby -Ku | |
require 'rubygems' | |
require 'mechanize' | |
require "hpricot" | |
require "kconv" | |
## overwrite Mechanize Class in set_headers section to overwrite http headers ## | |
module WWW | |
class Mechanize |
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
hello gist |
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
let s:commands = system('ditz --commands') | |
function! s:DitzComplete(cur, all, pos) | |
let args = split(strpart(a:all, 0, a:pos), ' ', 1) | |
if len(args) <= 2 | |
return s:commands | |
elseif index(split(s:commands), args[1]) != -1 | |
return system('ditz '.args[1].' "<options>"') | |
else |