Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
require 'tmpdir' | |
# Usage: | |
# add to ruhoh-site/plugins/publish/github.rb | |
# - Your GitHub remote must be setup properly but The command will try to walk you through it. | |
# - You must have a clean working directory to publish to GitHub pages since the hook is actually triggered by commits. | |
# | |
# $ cd ruhoh-site | |
# $ bundle exec ruhoh publish github | |
class Ruhoh |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
"------------------------------------ | |
" neosnippet | |
"------------------------------------ | |
" neosnippet "{{{ | |
" snippetを保存するディレクトリを設定してください | |
" example | |
" let s:default_snippet = neobundle#get_neobundle_dir() . '/neosnippet/autoload/neosnippet/snippets' " 本体に入っているsnippet | |
" let s:my_snippet = '~/snippet' " 自分のsnippet | |
" let g:neosnippet#snippets_directory = s:my_snippet |
/** | |
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript | |
* https://gist.github.com/faisalman | |
* | |
* Copyright 2012-2015, Faisalman <[email protected]> | |
* Licensed under The MIT License | |
* http://www.opensource.org/licenses/mit-license | |
*/ | |
(function(){ |
#! /bin/sh | |
# | |
# データベース作成スクリプト. | |
# 引数に渡されたパスにデータベースを構成・データを投入する | |
# | |
# | |
# sample: | |
# sh createDatabaseAs.sh db.sqlite3 | |
# |
駅データ.jp から以下のようなファイルをダウンロードし、 db/seeds/ekidata
とか適当な場所に置く:
マイグレーション:
# db/migrate/XXXXXXXXXXXXXX_create_ekidata_stations.rb
#!/bin/bash | |
COMPASS="/var/lib/gems/1.8/bin/compass" | |
case "$1" in | |
""|start) | |
echo "Starting compass watch..." | |
if [ -f ./cwatch.pid ] | |
then | |
echo "Sorry, but compass is already watching this folder..." |
Rails flash messages with AJAX requests
<?php | |
/** | |
* Simple excel writer class with no external dependencies, drop it in and have fun | |
* @author Matt Nowack | |
* @license Unlicensed | |
* @version 1.0 | |
*/ | |
class Excel { | |
private $col; |