Skip to content

Instantly share code, notes, and snippets.

@jun9
jun9 / x
Created April 8, 2009 08:41
//Note: This command was automatically generated by the create-new-search-command command.
CmdUtils.makeSearchCommand({
name: "alibaba-search",
url: "http://www.alibaba.com/trade/search?SearchText={QUERY}&IndexArea=product_en&=&=&=&ssk=y",
icon: "http://www.alibaba.com/favicon.ico",
description: "Searches www.alibaba.com"
});
@jun9
jun9 / ubuntu-1104-nginx-base.sh
Created January 8, 2012 14:12 — forked from predominant/ubuntu-1104-nginx-base.sh
Install Ubuntu 11.04 Nginx based web server with PHP-FPM, MySQL and MongoDB
#!/bin/bash
###
#
# Copyright (c) 2011 Cake Development Corporation (http://cakedc.com)
#
# Ubuntu 11.04 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 11.04 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/1264701)" <mysqlPassword>
@jun9
jun9 / gPlusBookmarklet.js
Created February 13, 2012 04:41
google plus bookmarklet
/**
* @author Jesse Lucas <jesse@forestgiant.com>
*/
var j = document.createElement("script");
j.type = "text/javascript";
j.onload = loadGPlus;
j.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName("head")[0].appendChild(j);
@jun9
jun9 / csvkit_tutorial.sh
Created April 26, 2012 06:08 — forked from onyxfish/csvkit_tutorial.sh
Full script for the csvkit tutorial (proof of process repeatability)
#!/bin/bash
###################
# Getting started #
###################
# Setup a workspace
mkdir va_benefits
cd va_benefits
Interactive charts and slides with R, googleVis and knitr
========================================
```{r results='asis', echo=FALSE, message=FALSE, tidy=FALSE}
library(googleVis)
G <- gvisGeoChart(Exports, "Country", "Profit",
options=list(width=250, height=120), chartid="c1")
T <- gvisBarChart(Exports[,1:2], yvar="Profit", xvar="Country",
options=list(width=250, height=260,
legend='none'), chartid="c2")
@jun9
jun9 / LICENSE.txt
Created June 30, 2012 13:53 — forked from sindresorhus/LICENSE.txt
Photo Booth (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jun9
jun9 / create_php_site.sh
Created September 17, 2012 11:57
Nginx and PHP-FPM, bash script for creating new vhost’s under separate fpm pools
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@jun9
jun9 / README.md
Created November 21, 2012 03:09 — forked from mbostock/.block
Bullet Charts

Designed by Stephen Few, a bullet chart “provides a rich display of data in a small space.” A variation on a bar chart, bullet charts compare a given quantitative measure (such as profit or revenue) against qualitative ranges (e.g., poor, satisfactory, good) and related markers (e.g., the same measure a year ago). Layout inspired by Stephen Few. Implementation based on work by Clint Ivy, Jamie Love of N-Squared Software and Jason Davies. The "update" button randomizes the values slightly to demonstrate transitions.

@jun9
jun9 / server.R
Created November 21, 2012 03:26 — forked from jean-robert/server.R
Prime Factorization Visualization in R and Shiny
library(shiny)
library(gmp)
drawStar <- function(center, length, pts, direction=0, segments=F, colour=F) {
if(length(pts)==0) return()
if(segments & (pts[1]==2)) direction <- direction + pi/2
for(i in 1:pts[1]) {
point <- center +
length*c(cos(direction+pi/2+i*2*pi/pts[1]),
sin(direction+pi/2+i*2*pi/pts[1]))
@jun9
jun9 / gist:4259182
Created December 11, 2012 15:07 — forked from jcbagneris/gist:4250572
Coursera Computational Finance Course - HW3 helper
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Comp. Finance Course HW3 : Simulator
"""
import argparse as ap
import datetime as dt
import pandas as pd
import qstkutil.qsdateutil as du