Skip to content

Instantly share code, notes, and snippets.

View eiel's full-sized avatar

HIMURA Tomohiko eiel

View GitHub Profile
(custom-set-variables
'(org-display-custom-times t)
'(org-time-stamp-custom-formats (cons (concat "<%Y/%m/%d " (substring (current-time-string) 0 3) ">")
(concat "<%Y/%m/%d " (substring (current-time-string) 0 3) " %H:%M>")))
)
;;; 訂正版
(custom-set-variables
'(org-time-stamp-custom-formats (quote ("<%Y/%m/%d %a>" . "<%Y/%m/%d %a %H:%M>")))
)
# -*- coding: utf-8 -*-
require 'rubygems'
require 'mechanize'
require 'rubytter'
######################
#mixiのログイン情報
######################
mixi_username ='xxxx@xxx.xxx' #mixiのログイン用メールアドレス
mixi_password ='xxxxxxx' #mixiのログイン用パスワード
__FILE__
__FUNCTION__
__LINE__
__METHOD__
abs
abstract
acos
acosh
addcslashes
addslashes
var links = document.getElementsByTagName("a");
for ( var i = 0 ; i < links.length ; i++ ){
(function() {
var n = i;
var link = links[i];
link.href = "#";
link.onclick = function(){ alert( n ) };
link.innerHTML = n;
})()
@eiel
eiel / helm-git-project.el
Created May 17, 2012 10:14
anything-git-projectを参考にhelmに変更しつつ、自分好みに調整。
;; original is http://d.hatena.ne.jp/yaotti/20101216/1292500323
;; patch from usk_t(https://gist.github.com/747399)
(defvar helm-git-project-dir nil)
(defun git-project:root-dir ()
(file-name-directory (file-truename
(shell-command-to-string "git rev-parse --git-dir"))))
(defun helm-git-project:create-source (name options)
`((name . ,(concat "Git Project " name))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Ocmgen" . ruby-mode))
(defun ruby-mode-hook-init ()
"encodingを自動挿入しないようにする"
(remove-hook 'before-save-hook 'ruby-mode-set-encoding)
(define-key ruby-mode-map " " nil)
(define-key ruby-mode-map "\C-ce" 'my-ruby-mode-set-encoding)
(define-key ruby-mode-map "\C-j" nil))
@eiel
eiel / gist:3051612
Created July 5, 2012 05:54
RailsでいつもかいてるGemfileメモ
gem 'therubyracer'
# rspec, cucumber
group :test, :development do
gem "rspec-rails", "~> 2.6"
gem "capybara"
gem "spork-rails"
gem "autotest"
gem "autotest-rails"
gem 'rspec-html-matchers'
# encoding: utf-8
require 'rubygems'
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open("http://creofuga.net/"),nil,"utf-8")
open("foo.txt", "w") do |f|
doc.css("td").each do |td|
f.puts td.text
end
@eiel
eiel / rack_test.rb
Created November 29, 2012 00:53
rack と erb の sample 初期状態
require 'rubygems'
require 'rack'
require 'erb'
class RackApp
def call(env)
[200, {'Content-Type' => 'text/html'}, [<<END_HTML]
<html>
<head><title>Rack test</title></head>
@eiel
eiel / gist:4435598
Last active December 10, 2015 12:38
javascriptの説明で使うだけ。
var Dog = function( t_name, t_color ){
this.name = t_name;
this.color = t_color;
};
Dog.prototype.bow = function () {
alert( this.name );
};
var taro = new Dog( "taro", "black" );