Skip to content

Instantly share code, notes, and snippets.

@tomjamescn
tomjamescn / .vimrc
Last active December 8, 2017 22:40
.vimrc
set ts=4
set shiftwidth=4
set cindent
set expandtab
syntax on
@tomjamescn
tomjamescn / _service.md
Created December 8, 2017 22:17 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@tomjamescn
tomjamescn / compile_tmux.sh
Created December 2, 2017 01:20 — forked from tessus/compile_tmux.sh
compile tmux (static)
#!/bin/bash
TMUX_VERSION=2.3
NCURSES_VERSION=6.0
LIBEVENT_VERSION=2.0.22
BASEDIR=${HOME}/work/tmux-static
TMUXTARGET=${BASEDIR}/local
mkdir -p $TMUXTARGET
cd $BASEDIR
@tomjamescn
tomjamescn / .block
Created June 6, 2017 23:50 — forked from mbostock/.block
Brush & Zoom
license: gpl-3.0
@tomjamescn
tomjamescn / bulebird_Promise.each.js
Last active May 24, 2017 14:27 — forked from stephantabor/bb.js
Bluebird .each vs .mapSeries vs .map
var Promise = require('bluebird');
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n)));
funcs
.each(iterator) // logs: 500, 100, 400, 200
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ]
funcs
.mapSeries(iterator) // logs: 500, 100, 400, 200
@tomjamescn
tomjamescn / yii2-app-basic-composer.json
Created December 4, 2015 22:10
yii2-app-basic composer.json
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
@tomjamescn
tomjamescn / dabblet.css
Created December 29, 2013 13:37
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.