Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
# Don't forget to run this vagrant command first | |
# vagrant ssh-config >> ~/.ssh/config | |
set :user, 'vagrant' | |
set :run_method, :sudo | |
role :app, '33.33.33.10' | |
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile`.split.last |
ja: | |
admin: | |
js: | |
true: True | |
false: False | |
is_present: 存在する | |
is_blank: 空白 | |
date: 日付 ... | |
between_and_: ... から ... | |
today: 今日 |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
require 'httparty' | |
response = HTTParty.get('http://www.google.com/ig/api?weather=Chicago') | |
data = response.parsed_response | |
puts data['xml_api_reply']['weather']['current_conditions']['condition']['data'] |
full_data = { | |
response: {body: StyledYAML.literal(DATA.read), status: 200}, | |
person: StyledYAML.inline('name' => 'Steve', 'age' => 24), | |
array: StyledYAML.inline(%w[ apples bananas oranges ]) | |
} | |
StyledYAML.dump full_data, $stdout | |
__END__ | |
{ |
Please check here for an up-to-date config for a WISP (wireless ISP) setup on OpenWrt 14.07.
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
#!/bin/bash | |
# | |
# inotify-git | |
# | |
# 対象ディレクトリを再帰的に監視し、 | |
# 変更をすべて git で自動コミットする | |
# | |
# 再起動しても勝手に監視させるには | |
# /etc/rc.local に | |
# /path/to/inotify-git directory & |
基礎知識
読み物系
#!/usr/bin/env perl | |
use strict; | |
use utf8; | |
use warnings; | |
use Encode; | |
use MIME::Base64; | |
use Net::SMTP; | |
use Authen::SASL; |