This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('debug').enable('TEST:*'); | |
var a = require('debug')('TEST:a'); | |
var b = require('debug')('TEST:b'); | |
var c = require('debug')('c'); | |
a('aaaaaa'); | |
b('bbbbbb'); | |
c('cccccc'); | |
a('aaaaaa'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = {x:1, y:2}; | |
var b = {x:3, y:4}; | |
var arr = [a, b]; | |
console.log(arr.indexOf(a)); //0 | |
console.log(arr.indexOf({x:1, y:2})); //-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Immutable = require('immutable'); | |
var arr = ['a', 'b', 'c']; | |
var o = Immutable.List(arr); | |
console.log(o); //List [ "a", "b", "c" ] | |
console.log(typeof o); //object | |
console.log(JSON.stringify(o)); //["a","b","c"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
" Vundle | |
" """""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/vundle' | |
Plugin 'altercation/vim-colors-solarized' | |
Plugin 'godlygeek/tabular' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
let Hello = React.createClass({ | |
render(){ | |
return( | |
<div> | |
<h1>Hello 贊啦!!</h1> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
val pw = new PrintWriter(new File("hello.txt" )) | |
val lines = "'"+Source.fromFile("power-users-list.csv").getLines.toList.mkString("','")+"'" | |
pw.write(lines) | |
pw.close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_sbtnew(){ | |
mkdir -p $1/project | |
cd $1 | |
echo 'sbt.version = 0.13.11' > project/build.properties | |
cat << _EOF_ > build.sbt | |
name := "$1" | |
version := "1.0" | |
scalaVersion := "2.11.8" | |
_EOF_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int value; | |
int value2; | |
value = getchar(); | |
value2 = value != EOF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const async = require('async'); | |
const bcrypt = require('bcrypt'); | |
const MongoClient = require('mongodb').MongoClient; | |
const NAME = 'mockuser'; | |
const PWD = 'mockpwd'; | |
const NUM = 5; | |
const URL = 'mongodb://localhost:27017/myApp'; | |
const USERS = 'users'; | |
const FOLDERS = 'folders'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"net/http" | |
) | |
type Person struct { |
OlderNewer