Skip to content

Instantly share code, notes, and snippets.

@koseki
koseki / jp-prefectures.html
Last active January 31, 2024 11:35
Japanese Prefectures 日本の都道府県 Text, JS, HTML 漢字, ローマ字, 都道府県コード
<select>
<option value="1">Hokkaido</option>
<option value="2">Aomori</option>
<option value="3">Iwate</option>
<option value="4">Miyagi</option>
<option value="5">Akita</option>
<option value="6">Yamagata</option>
<option value="7">Fukushima</option>
<option value="8">Ibaraki</option>
<option value="9">Tochigi</option>
@emergent
emergent / mechanize_with_proxy_and_basicauth.rb
Created October 30, 2012 23:47
Using mechanize with proxy and basic auth
require 'rubygems'
require 'mechanize'
agent = Mechanize.new
agent.set_proxy('proxy.example.com', 80, 'username', 'password')
agent.add_auth('http://hoge.com','b_username','b_password')
agent.user_agent_alias = "Windows Mozilla"
res = agent.get('http://hoge.com/some/page')
puts res.body
@tsu-nera
tsu-nera / .zshrc
Created May 25, 2013 12:55
.zshrcのとりあえず記録用
###############
# zsh Setting
###############
###############
# ヒストリ関連
###############
# 履歴の保存先
HISTFILE=$HOME/.zsh-history
## メモリに展開する履歴の数
@komasaru
komasaru / google_geocode.rb
Last active July 11, 2019 02:15
Ruby script to get a address or latitude, longitude with Google Geocoding API.
#*********************************************
# 住所から緯度・経度を取得する、又は、
# 緯度・経度から住所を取得する。
# ( by Google Geocode API )
#*********************************************
#
require 'json'
require 'net/http'
BASE_URL = "http://maps.googleapis.com/maps/api/geocode/json"
@kidach1
kidach1 / file0.txt
Created November 18, 2013 01:43
Railsを触る際知っていると便利なRubyの基礎 [ブロックとかシンボルとか] ref: http://qiita.com/kidachi_/items/46a6e49b6306655ccd64
#配列要素の分割
> "foo bar bazz".split
=> ["foo", "bar", "bazz"]
#配列要素の指定文字列での分割
> "fooxbarxxxxbazz".split('x')
=> ["foo", "bar", "", "", "", "bazz"]
#配列要素の順番入れ替え
@JamieMason
JamieMason / unfollow.js.md
Last active May 16, 2024 03:26
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
@voluntas
voluntas / shiguredo_recruit.rst
Last active May 18, 2024 14:38
時雨堂を支える採用
@nejstastnejsistene
nejstastnejsistene / webcrawler.go
Created May 5, 2014 17:01
My solution to the Go Tour Web Crawler
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
@jonobr1
jonobr1 / auto-capture.scpt
Last active March 21, 2024 02:34
A small AppleScript to take a screenshot every 30 seconds for 8 hours. Saves to an Image Sequence in a desktop folder. Great for recording your workday.
set dFolder to "~/Desktop/screencapture/"
do shell script ("mkdir -p " & dFolder)
set i to 0
repeat 960 times
do shell script ("screencapture " & dFolder & "frame-" & i & ".png")
delay 30 -- Wait for 30 seconds.
set i to i + 1
end repeat
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL