Skip to content

Instantly share code, notes, and snippets.

module Gominashi
SOURCES = [
{
name: "toyohira_1",
areas: [
"豊平区 豊平○条○丁目",
"豊平区 旭町○丁目",
"豊平区 水車町○丁目",
],
types: {
@irasally
irasally / BitlyAPI.php
Last active December 27, 2015 05:49
[CakePHP]GET Shorten URL using BitlyAPI
<?php
// app/Lib/BitlyAPI.php
App::uses('HttpSocket', 'Network/Http');
class BitlyAPI {
const LOGIN_ID = "Your ID";
const API_KEY = "Your API Key";
/* 短縮URLを含むjsonを取得する
* = example response =
* {
@irasally
irasally / Boxfile
Last active December 23, 2015 14:19
pagoda Boxfile for CakePHP
web1:
document_root: /app/webroot
shared_writable_dirs:
- app/tmp
- app/tmp/cache
- app/tmp/logs
- app/tmp/sessions
- app/tmp/tests
php_version: 5.4.14
php_extensions:
@irasally
irasally / git-commands
Last active December 12, 2015 03:18
git basic commands.
== basic
$ git init
$ git add .
$ git status
$ git commit
== push
$ git remote add origin [url]
$ git push -u origin master
# "git push" に "-u" あるいは "--set-upstream" を付けると、push 先のブランチをトラック (デフォルトで push や pull の対象に) するように設定されます。
@irasally
irasally / gist:3972315
Created October 29, 2012 08:20
cannot create pdf using wkhtmltopdf
$ cd sinatra-book/
$ bundle exec rake book:build --trace
** Invoke book:build (first_time)
** Execute book:build
/home/irasally/sinatra-book/vendor/wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
rake aborted!
command failed: "/home/irasally/sinatra-book/vendor/wkhtmltopdf" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-left" "0.75in" "--encoding" "UTF-8" "--quiet" "-" "-"
/home/irasally/.rvm/gems/ruby-1.9.3-p286@sinatra-book/gems/pdfkit-0.5.2/lib/pdfkit/pdfkit.rb:71:in `to_pdf'
/home/irasally/sinatra-book/book.rb:21:in `build'
/home/irasally/sinatra-book/Rakefile:7:in `block (2 levels) in <top (required)>'
@irasally
irasally / run.sh
Created October 3, 2012 05:07
[mongodb] run command 'compact' for all collections
#!/bin/sh
mongo localhost:27017/mongo run_command.js
mongo localhost:27018/mongo run_command.js
mongo localhost:27019/mongo run_command.js
# if you don't need connection infomation etc., use --quiet option.
# http://www.mongodb.org/display/DOCS/--quiet
@irasally
irasally / logcheck_command.txt
Created September 27, 2012 01:19
同じ単語がいくつ出てきたかを調べるコマンド
$ cat some.log | sort | uniq -c | sort -n
1 id:0000123 success. [335 msec]
1 id:0000456 success. [320 msec]
1 id:0001234 success. [318 msec]
1 use TABLE3_0000000001
2 use TABLE1_0000000001
4 use TABLE2_0000000001
#### some.log
@irasally
irasally / brew_install_git_logs
Created February 28, 2012 08:51
$brew install git is faild.(Mac OS X 10.6.8/ XCode 4.2)
$ brew install git
==> Downloading http://git-core.googlecode.com/files/git-1.7.9.2.tar.gz
File already downloaded in /Users/xxx/Library/Caches/Homebrew
==> make prefix=/usr/local/Cellar/git/1.7.9.2 CC=/usr/bin/llvm-gcc CFLAGS=-Os -w -pipe -march=core2 -msse4.1 LDFLAGS= install
GIT_VERSION = 1.7.9.2
* new build flags or prefix
* new link flags
./generate-cmdlist.sh > common-cmds.h+ && mv common-cmds.h+ common-cmds.h
rm -f git-am git-am+ && sed -e '1s|#!.*/sh|#!/bin/sh|' -e 's|@SHELL_PATH@|/bin/sh|' -e 's|@@DIFF@@|diff|' -e 's/@@GIT_VERSION@@/1.7.9.2/g' -e 's|@@LOCALEDIR@@|/usr/local/Cellar/git/1.7.9.2/share/locale|g' -e 's/@@NO_CURL@@//g' -e '/^# @@BROKEN_PATH_FIX@@$/d' git-am.sh >git-am+ && \
chmod +x git-am+ && \
@irasally
irasally / brew_doctor
Created February 27, 2012 06:41
$brew doctor を実行した結果。(現在、 brew install git が失敗する)
$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libasprintf.0.dylib
/usr/local/lib/libcharset.1.0.0.dylib
/usr/local/lib/libexpat.1.5.2.dylib
@irasally
irasally / rvm_cygwin_permission_denied_log
Created February 2, 2012 09:02
Installing rvm on cygwin occurred Permission denied
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 125 100 125 0 0 80 0 0:00:01 0:00:01 --:--:-- 592
100 799k 100 799k 0 0 123k 0 0:00:06 0:00:06 --:--:-- 183k
Upgrading the RVM installation in /home/xxx/.rvm/
cp: cannot open `/home/xxx/.rvm/src/rvm/patches/ree/1.8.7/zlib-gc-fix.diff' for reading: Permission denied
RVM sourcing line found in: /home/xxx/.bashrc.