View demo.tex
%!TEX program = xelatex
% Font Size:
% 10pt, 11pt, 12pt
% Paper Size:
% a4paper, letterpaper, a5paper, leagalpaper, executivepaper, landscape
% Font Family:
% roman, sans
\documentclass[12pt, a4paper, roman]{moderncv}
% Style:
View ip_in_range.php
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
View psql-with-gzip-cheatsheet.sh
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
View 年轻的妹子别以为自己年轻就是优势--熟女引发的凶杀案.md

电视里看到一个专题片,因为最后事发时只有熟女在场,片子里大部分是这个熟女在讲述。

说是一对中年夫妻,有一对十几岁的女儿,家庭幸福。可后来有一天老公忽然向熟女坦白他有外遇,熟女的回答是:你赶快改正错误!

老公对这个反应很惊讶,因为一般女人听到这种事都会跳起来,但他仍然不愿意改。熟女在一家律师事务所做办公助理,忽然被解雇,雪上加霜。熟女人生陷入低谷。

正好此时有个年轻小伙法学院毕业,刚开了个自己的事务所,熟女去申请工作,立刻就被录用,然后俩人就搞在了一起。熟女说:老公有了外遇后,我只是想被人爱,被人捧,其他什么都没想。

他们的关系后来被她老公察觉,老公很愤怒,但熟女想办法骗了过去。

View RubyConfChina.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View swap.sh
#!/bin/bash
# find-out-what-is-using-your-swap.sh
# -- Get current swap usage for all running processes
# --
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version
SCRIPT_NAME=`basename $0`;
View .zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
View railscast
http://media.railscasts.com/assets/episodes/videos/001-caching-with-instance-variables.mp4
http://media.railscasts.com/assets/episodes/videos/002-dynamic-find-by-methods.mp4
http://media.railscasts.com/assets/episodes/videos/003-find-through-association.mp4
http://media.railscasts.com/assets/episodes/videos/004-move-find-into-model.mp4
http://media.railscasts.com/assets/episodes/videos/005-using-with-scope.mp4
http://media.railscasts.com/assets/episodes/videos/006-shortcut-blocks-with-symbol-to-proc.mp4
http://media.railscasts.com/assets/episodes/videos/007-all-about-layouts.mp4
http://media.railscasts.com/assets/episodes/videos/008-layouts-and-content-for.mp4
http://media.railscasts.com/assets/episodes/videos/009-filtering-sensitive-logs.mp4
http://media.railscasts.com/assets/episodes/videos/010-refactoring-user-name-part-1.mp4
View .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases