Skip to content

Instantly share code, notes, and snippets.

View xnzacc's full-sized avatar

Zac Z. xnzacc

  • UK
View GitHub Profile
@xnzacc
xnzacc / leaflet-0-8-dev.js
Created April 21, 2014 08:16
leaflet-0-8-dev.js
/*
Leaflet 0.8-dev (c5091ee), a JS library for interactive maps. http://leafletjs.com
(c) 2010-2014 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
(function (window, document, undefined) {
var L = {
version: '0.8-dev'
};
function expose() {
@xnzacc
xnzacc / gist:11131425
Created April 21, 2014 03:24
Contagious: Why Things Catch On
Contagious: Why Things Catch On
By Jonah Berger
Simon & Schuster Readers Group Guide
What makes products and ideas catch on and become popular? Why do some stories get shared more than others? Why are some rumors infectious? What makes things “go viral”?
In Contagious, Jonah Berger shares the secret science behind social transmission. Why we talk about and share some things rather than others. Why we pass things on. Filled with engaging stories and comprehensive research Contagious is an essential tool for anyone that wants to make their product or idea spread.
QUESTIONS FOR DISCUSSION
1) Consider and discuss the most recent email forward you received. It might have been a news article, video, or story. What aspects of the STEPPS framework did it adhere to? Do the same analysis for the last viral video you watched, hot restaurant you tried, hit movie you saw, etc. Which concepts in the framework apply?
2) Which examples that Berger mentioned (e.g., Blendtec, Dove’s Evolution, white iPhone earbuds) had you bee
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Record timeout="30" transcribe="true" />
</Response>
@xnzacc
xnzacc / bundle_install_taobao.sh
Created November 18, 2013 07:51
Simple script to replace first line of Gemfile with taobao's rubygem mirror url for faster bundle install's
# Simple script to replace first line of Gemfile with taobao's rubygem mirror url
echo "Copying Gemfile to Gemfile_taobao using ruby.taobao.org"
echo
taobao="'source http\:\/\/ruby.taobao.org'"
sed "1s/.*/$taobao/" Gemfile > Gemfile_taobao
echo "bundle install --gemfile Gemfile_taobao --local"
bundle install --gemfile Gemfile_taobao --local
@xnzacc
xnzacc / how-to-search-in-forks
Created October 16, 2013 07:19
Search in forks for a fix/feature/anything good in commits from fork authors
# Motivation: you want to search in forks for an urgent fix
# I've wanted to do this a few times but couldn't find any other way to,
# so wrote this.
# 1) git clone main repo
# 2) in cloned folder, fetch all commits using script from https://gist.github.com/zaczheng/7003545
# 3) search in forks(excluding main author) for patterns in
@xnzacc
xnzacc / github-fetch-forks
Last active December 25, 2015 16:09
Fetch all forks of github repository. Uses gems 'github_api' and 'hub'
#!/usr/bin/env ruby
# Install gems:
# gem install github_api
# gem install hub
#
# Then run script in github repo
require 'github_api'
g = Github.new
@xnzacc
xnzacc / rgeo.rb
Created August 27, 2013 09:22
Add as_georss / as_kml methods as used by GeoRuby to RGeo::Cartesian::PointImpl
# add to config/initializers/
module GeoPointConversion
def as_georss
"<georss:point>#{y} #{x}</georss:point>\n"
end
def as_kml
"<Point>\n<coordinates>#{y},#{x}</coordinates>\n</Point>\n"
end
end
@xnzacc
xnzacc / gist:3664238
Created September 7, 2012 08:00
北京欢迎你
北京欢迎你
作曲:小柯
作词:林夕
演唱:谭晶&谭智元
歌词制作:刘荣华(2008 8 26)
迎接另一个晨曦 带来全新空气
气息改变情味不变 茶香飘满情谊
我家大门常打开 开放怀抱等你
拥抱过就有了默契 你会爱上这里
@xnzacc
xnzacc / .tmux.conf
Created April 6, 2012 15:19 — forked from while0pass/.tmux.conf
My .tmux.conf set up based on http://pragprog.com/book/bhtmux/tmux
# Set prefix command to Ctrl-i; one of the easiest keys to reach
set -g prefix C-b
unbind C-a
# Reduce tmux delay for more responsiveness
set -sg escape-time 1
# Window and pane index count starts in 1 rather tan 0
set -g base-index 1
setw -g pane-base-index 1
@xnzacc
xnzacc / gist:1264178
Created October 5, 2011 11:01
Load javascript onto an existing web page
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= '/js-file.js';
document.head.appendChild(script);