Skip to content

Instantly share code, notes, and snippets.

View ericstone57's full-sized avatar

ericstone57 ericstone57

  • Kantar
  • Shanghai
View GitHub Profile
@yuyalush
yuyalush / install_ab.sh
Created September 18, 2011 15:08
Install ApacheBench to CentOS5.6
yum -y install apr apr-util yum-utils
mkdir ~/httpd
cd ~/httpd
yumdownloader httpd
rpm2cpio httpd-2.2.3-53.el5.centos.1.x86_64.rpm | cpio -idmv
mv usr/bin/ab /usr/bin/ab
cd ~
rm -rf ~/httpd
ab http://google.ru/
@penguinbroker
penguinbroker / gist:1378258
Created November 19, 2011 01:15
Paper.js hit test
hitTool = new paper.Tool();
hitTool.activate();
hitTool.onMouseDown = function (event) {
hitOptions = {
segments: true,
stroke: true,
fill: true,
tolerance: 5
};
hitResult = paper.project.hitTest(event.point, hitOptions);
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@gre
gre / easing.js
Last active May 8, 2024 14:30
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@gagarine
gagarine / install_php_ngninx.sh
Created February 17, 2012 14:18
Drupal on php-fpm + nginx + apc
brew update
brew install gmp
#install Nginx
brew install nginx
# copy launch script
cp /usr/local/Cellar/nginx/1.0.12/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
#try to launch Nginx
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@petemcw
petemcw / gist:2719758
Created May 17, 2012 15:53
Commands to clean a Ubuntu install for smaller Vagrant packages
# Remove items used for building, since they aren't needed anymore
apt-get clean
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove
# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
# Removing leftover leases and persistent rules
@leon
leon / nginx.conf
Created June 29, 2012 16:34
Nginx PHP-FPM Symfony 2 minimal config
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@ddesilva
ddesilva / ga-tracking-helper.js
Created July 9, 2012 23:24
Require.js Module for the Google Analytics API
define(['require', 'exports'], function(require, exports) {
exports.GATrackingHelper = function(settings) {
// MEMBERS & DEFAULTS
var urchinId = settings.gaqId || false,
devId = settings.devId || 'UA-3172639-5',
page = settings.page || null,
trackingLabel = settings.label || false,
domainName = settings.domainName || '.defencejobs.gov.au',