Skip to content

Instantly share code, notes, and snippets.

View zilongshanren's full-sized avatar
🎯
Focusing

子龙山人 zilongshanren

🎯
Focusing
View GitHub Profile
@zilongshanren
zilongshanren / .eslintrc
Created May 12, 2016 03:34 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@zilongshanren
zilongshanren / .bashrc
Created March 30, 2016 08:01 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@zilongshanren
zilongshanren / statemachine.lua
Created March 14, 2016 06:39 — forked from erinlin/statemachine.lua
coronaSDK-coroutine-statemachine
--[[
statemachine.lua
Copyright (c) 2013 Erin Lin
erinylin.blogspot.com
Licensed under the MIT license.
Usage:
local sm = require("statemachine")
local process = sm.new(function(self, time)
@zilongshanren
zilongshanren / pre-commit-eslint
Created March 10, 2016 02:30 — forked from linhmtran168/pre-commit-eslint
Pre-commit hook to check for Javascript using ESLint
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@zilongshanren
zilongshanren / springer-free-maths-books.md
Created December 29, 2015 13:29 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@zilongshanren
zilongshanren / src.multi-method.clj
Created December 25, 2015 08:34 — forked from tolitius/src.multi-method.clj
clojure bootcamp: "defmulti" example
;; inspired by suggestion in THE doc: http://java.ociweb.com/mark/clojure/article.html
(ns bootcamp.multi-method)
(defn measure-it [size]
(cond
(< size 3) :small
(< size 6) :medium
(< size 12) :large
:else :hard-to-measure ))
@zilongshanren
zilongshanren / Emacs_starter.pl
Created December 11, 2015 07:06 — forked from railwaycat/Emacs_starter.pl
Start Emacs.app from CLI
#!/usr/bin/perl
# Emacs starter for Emacs mac port
# Thanks to Aquamacs Project and David Reitter
my $args = "";
my $tmpfiles = "";
for my $f (@ARGV) {
@zilongshanren
zilongshanren / pre-commit
Last active April 8, 2016 02:23 — forked from scottrabin/pre-commit
js precommit hook for jshint, jsbeautify
#!/usr/bin/env python
import subprocess
import sys
import os.path, time
def get_modified_time(file):
return time.ctime(os.path.getmtime(file))
def run_js_tools(files_str):
"""Iterate though list and run code quality tools"""
@zilongshanren
zilongshanren / init.el
Last active April 8, 2016 02:20
spacemacs chinese font setup
(when (configuration-layer/layer-usedp 'chinese)
(when (spacemacs/system-is-mac)
(spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16)))
@zilongshanren
zilongshanren / proxy_nginx.sh
Last active November 9, 2019 20:41 — forked from rdegges/proxy_nginx.sh
Create a HTTP proxy for jenkins using NGINX.
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;