Skip to content

Instantly share code, notes, and snippets.

class User < ActiveRecord::Base
attr_accessible :name, :password, :status
end
@murayama333
murayama333 / gist:1087427
Created July 17, 2011 10:18
Textmate web2py bundle-command
#!/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*[\:\(]")
# -*- coding: undecided -*-
require "http_util"
#なんちゃってDSL
browse http.twitter.com
browse http.yahoo.co.jp
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
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
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
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
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
(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))))))
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