This file contains hidden or 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
# encoding: utf-8 | |
require 'socket' | |
module Kernel | |
def sw(*args) | |
args.each do |arg| | |
TCPSocket.open('localhost', 12345) {|s| s.write arg } | |
end | |
end |
This file contains hidden or 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 'fileutils' | |
require 'net/http' | |
require 'instagram' | |
USER_ID = # Your id as integer. | |
def main | |
photos = Instagram::by_user(USER_ID) | |
photos.each do |photo| |
This file contains hidden or 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
SESSION_NAME='t' | |
tmux has-session -t $SESSION_NAME | |
if [ $? -ne 0 ]; then | |
tmux -q new-session -s $SESSION_NAME | |
elif [ "$TMUX" = "" ]; then | |
echo '==== tmux ========================================' | |
tmux list-clients | |
echo "tmux attach-session -d -t $SESSION_NAME" | |
echo '======================================== tmux ====' |
This file contains hidden or 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
" Vim color file | |
" | |
" Name: yo.vim | |
" Maintainer: yoshuki <yoshuki_at_saikyoline_dot_jp> | |
" Last Change: 25 May 2011 | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset |
This file contains hidden or 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 'drb/drb' | |
require 'java' if defined?(JRUBY_VERSION) | |
class PutsOrPrintln | |
def puts_or_println(str) | |
if defined?(JRUBY_VERSION) | |
java.lang.System.out.println(str) | |
"JRuby" | |
else | |
puts(str) |
This file contains hidden or 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
<?php | |
/** WordPressの設定ファイル */ | |
require_once('wp-config.php'); | |
$db = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); | |
mysql_select_db(DB_NAME, $db); | |
$sql = "SELECT post_date, post_name FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC"; | |
$result = mysql_query($sql, $db); |
This file contains hidden or 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 ruby -Ku | |
require 'net/http'; Net::HTTP.version_1_2 | |
require 'rexml/document' | |
module Atok_plugin | |
AWS_ACCESS_KEY_ID = '0123456789ABCDEFGHIJ' # あなたの「AWS Access Key ID」に置き換えてください。 | |
def run_process(request) | |
doc = REXML::Document.new(fetch_amazon(request['composition_string'])) |
This file contains hidden or 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
# jpMobileのUTF-8内部表現をimgタグに変換するフィルタ | |
# 変換テーブル | |
require 'jpmobile/emoticon/docomo_unicode_to_typepad' | |
class ActionController::Base #:nodoc: | |
def self.emoticon_filter(options = {}) | |
around_filter Jpmobile::Filter::Emoticon::Taggable.new(options) # 数値文字参照<->IMGタグ | |
end | |
end |
This file contains hidden or 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
## | |
# Autotest::Screen is test result notify GNU Screen's statusline. | |
# | |
# === screenshots | |
# * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015543.png" /> | |
# * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015522.png" /> | |
# | |
# == SYNOPSIS | |
# require 'autotest/screen' | |
# # Autotest::Screen.statusline = '%H %`%-w%{=b bw}%n %t%{-}%+w (your statusline)' |
NewerOlder