Skip to content

Instantly share code, notes, and snippets.

View fredchu's full-sized avatar
🏠
Working from home

Fred Chu fredchu

🏠
Working from home
View GitHub Profile
require 'flickraw'
require 'mini_magick'
require 'parallel'
def get_photo_urls_from_photoset(flickr, photoset_id)
total_pages = nil
current_page = 1
urls = []
opts = {
photoset_id: photoset_id,
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias p='cd ~/pinkoi/pinkoi'
alias reg='sudo restart gunicorn CONF=fredchu'
alias rer='sudo restart rmq-consumer CONF=fredchu'
alias mmmbuild='mrbuild --skipintl --rootdir=/home/fredchu/www/pinkoi && reg'
alias tmux=tmux-next
# Lines configured by zsh-newuser-install
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
@fredchu
fredchu / tmux-cheatsheet.markdown
Created December 16, 2016 09:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@fredchu
fredchu / calc-detection.js
Last active October 26, 2015 05:10
Check if CSS calc() is available using JavaScript and Modernizr
Modernizr.addTest('csscalc', function() {
var prop = 'width:';
var value = 'calc(10px);';
var el = document.createElement('div');
el.style.cssText = prop + Modernizr._prefixes.join(value + prop);
return !!el.style.length;
});
@fredchu
fredchu / .jscs.json
Created July 16, 2015 02:32
My JSCS config
{
"preset": "airbnb",
"requireCurlyBraces": [ "if", "else", "for", "while", "do" ],
"requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return" ],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
@fredchu
fredchu / gist:145c60a1a653378d28a5
Created July 15, 2015 03:26
Undo the latest commit
git reset --soft HEAD^
@fredchu
fredchu / angular.html
Created March 19, 2015 16:10
Demo AngularJS
<!doctype html>
<html ng-app="todoApp">
<head>
<meta charset="UTF-8">
<title>Pinkoi Dev Sharing AngularJS Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
</head>
<body ng-controller="todoController">
<h1>Todos count: <span>{{todos.length}}</span></h1>
<ul id="list">
@fredchu
fredchu / react.html
Last active August 29, 2015 14:17
React Demo
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Pinkoi Dev Sharing ReactJS Demo</title>
</head>
<body>
<div id="wrap"></div>
<script src="https://fb.me/react-0.13.0.js"></script>
@fredchu
fredchu / jQuery.html
Last active August 29, 2015 14:17
jQuery Demo
<!doctype html>
<html>
<head>
<title>Pinkoi Dev Sharing jQuery Demo</title>
</head>
<body>
<h1>Todos count: <span id="todos-count">0</span></h1>
<ul id="list">
</ul>
<form id="form-todo" action="">