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 User < ActiveRecord::Base | |
attr_accessible :name, :password, :status | |
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
#!/usr/bin/env python | |
import sys | |
import re | |
import os | |
dir = os.environ["TM_DIRECTORY"] | |
if dir.find("controllers") != -1: | |
#controllers | |
re_symbol = re.compile(r"^(\s*)(?:class|def)\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*[\:\(]") |
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
# -*- coding: undecided -*- | |
require "http_util" | |
#なんちゃってDSL | |
browse http.twitter.com | |
browse http.yahoo.co.jp |
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 "open-uri" | |
class HttpUtil | |
def self.method_missing(method_name, *args) | |
HttpUtil.new(method_name) | |
end | |
def method_missing(method_name, *args) | |
@buf << method_name | |
self |
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 "open-uri" | |
class HttpUtil | |
def self.method_missing(method_name, *args) | |
HttpUtil.new(method_name) | |
end | |
def method_missing(method_name, *args) | |
@buf << method_name | |
self |
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 "open-uri" | |
class HttpUtil | |
def self.method_missing(method_name, *args) | |
HttpUtil.new(method_name) | |
end | |
def method_missing(method_name, *args) | |
@buf << method_name | |
self |
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 SQLUtil | |
def self.method_missing(method_name, *args) | |
SQLUtil.new(method_name) | |
end | |
def method_missing(method_name, *args) | |
@buf << method_name | |
self | |
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
class SQLBuilder | |
def self.method_missing(method_name, *args) | |
SQLBuilder.new(method_name) | |
end | |
def method_missing(method_name, *args) | |
@buf << method_name | |
self | |
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-to-list 'load-path "~/.emacs.d/elisp/apel") | |
(defun add-to-load-path (&rest paths) | |
(let (path) | |
(dolist (path paths paths) | |
(let ((default-directory (expand-file-name (concat user-emacs-directory path)))) | |
(add-to-list 'load-path default-directory) | |
(if (fboundp 'normal-top-level-add-subdirs-to-load-path) | |
(normal-top-level-add-subdirs-to-load-path)))))) |
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 "open-uri" | |
require 'rexml/document' | |
require 'cgi' | |
def read_gist(url, keyword, max) | |
response = open(url) | |
source = response.read | |
if(source.include?(keyword)) then | |
@counter = @counter + 1 |