brew install cmake
brew install python
sudo easy_install pip
Add powerline bin to your path. In your zshrc file (or the paths files sourced in zshrc) add the following line
PATH="/usr/local/share/python/:$PATH"
| #!/bin/sh | |
| # | |
| # a script to convert every CAF sound file in the current | |
| # directory to a corresponding AIF sound file. | |
| # | |
| # author: alvin alexander, devdaily.com | |
| # | |
| # This work is licensed under the Creative Commons Attribution-Share Alike 3.0 | |
| # United States License: http://creativecommons.org/licenses/by-sa/3.0/us/ |
| #!/usr/bin/env python | |
| import os | |
| import urllib2 | |
| import json | |
| import subprocess | |
| user=None | |
| repo=None |
| #!/usr/bin/env perl | |
| # Usage sample: | |
| # find <dir> -iname Makefile.am | while read m; do | |
| # echo "=== processing $m ==="; | |
| # ../scripts/autotools-cmake-convert.pl ${m} >"$(dirname $m)/CMakeLists.txt"; | |
| # done | |
| use v5.10.1; | |
| use experimental qw(smartmatch); | |
| use File::Basename; |
| # put this in your .bash_profile | |
| if [ $ITERM_SESSION_ID ]; then | |
| export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
| fi | |
| # Piece-by-Piece Explanation: | |
| # the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
| # iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
| # the $PROMPT_COMMAND environment variable is executed every time a command is run | |
| # see: ss64.com/bash/syntax-prompt.html |
| # This ordering will not work: | |
| resources :posts, :except => :index | |
| get "/posts" => "posts#index", :as => :posts | |
| # This ordering will work: | |
| get "/posts" => "posts#index", :as => :posts | |
| resources :posts, :except => :index | |
| # Both work, however, in Rails 3.2.13. |
| #!/usr/bin/python | |
| from PIL import Image, ImageColor | |
| import math | |
| import sys | |
| def closest_color(incolor, colors): | |
| distances = [] | |
| min_distance = 10000 | |
| for color in colors: |
| --Enable MySQL General Log | |
| SET global general_log = 1; | |
| SET global log_output = 'table'; | |
| --MySQL Dump | |
| mysqldump -uroot -ppassword dbname > dump.sql | |
| --enable access from a particular system | |
| GRANT ALL PRIVILEGES ON *.* TO root@106.51.132.21 identified by "password" |
| #!/bin/sh | |
| ## MySQL 5.1.61 | |
| ## sleep时间大于等于10秒,kill掉: | |
| mysqladmin -u* -p* processlist |grep -i sleep |awk '{if($12>=10) print $2}' |xargs -n1 mysqladmin -u* -p* kill | |
| // Build.h | |
| // -- autogenerated file by zettings.rb on 2013-12-10 00:09:25 +0100 | |
| #import "GeneratedBuild.h" | |
| @interface Build : GeneratedBuild | |
| + (instancetype)settings; | |
| // add properties here for custom behavior |