Skip to content

Instantly share code, notes, and snippets.

View louisje's full-sized avatar
💯
左手寫程式 (">_<) 右手做測試

Louis Jeng louisje

💯
左手寫程式 (">_<) 右手做測試
View GitHub Profile
var logger = console.log;//<?php function logger($msg) {echo "\n".$msg;};
function fibonacci($seq) {
if ($seq < 2) {
return $seq;
} else {
return fibonacci($seq - 1) + fibonacci($seq - 2);
}
}
@louisje
louisje / vimrc.vim
Created August 26, 2012 03:33
vimrc sample
set nocompatible " not compatible with the old-fashion vi mode
set backspace=2 " allow backspacing over everything in insert nc >kkmode
set history=1000 " keep 1000 lines of command line history
set undolevels=100
set ruler " show the cursor position all the time
set autoread " auto read when file is changed from outside
set wrap
set linebreak
set nolist
set hidden
@louisje
louisje / sprintf.js
Created July 23, 2012 10:42
Javascript sprintf()
/**
* sprintf()
*/
(function() {
define(function() {
return function() {
var convert = function(match, nosign) {
if (nosign) {
@louisje
louisje / install-outland.sh
Created July 20, 2012 02:44
outland installation script
#!/bin/bash
cd $HOME
wget -qO- http://outland.s3.amazonaws.com/outland.tar.gz | tar zxvf -
#git clone git://github.com/louisje/outland.git
outland/bin/ol-build
echo
echo "You need to \`source .bash_profile\` to make everything active"
echo
@louisje
louisje / css.js
Created July 13, 2012 04:33
A RequireJS plugin to load css file
/**
* RequireJS Plugin - CSS Loader
*
* [ex.]
* define(['css!jquery-ui-css', 'jquery', 'jquery-ui'], { });
*
* Its better to put 'css!' in front of other js dependencies to get
* faster loading speed
*
*/