Skip to content

Instantly share code, notes, and snippets.

@taiansu
taiansu / vimrc
Created October 5, 2016 17:05
Minimal vimrc
syntax on
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,big5,gb2312,latin1
set ffs=unix,mac,dos
colorscheme pablo
set t_Co=256
@taiansu
taiansu / app.js
Created August 10, 2016 10:46
Phoenix brunch config which just make sense
import "phoenix_html"
import "bootstrap"
import "jquery"
import "toastr"
// ...
import React from 'react';
const Item = React.createClass({
handleClick() {
this.props.itemClicked(this.props.index);
},
render() {
return <li onClick={this.handleClick} className={this.props.className}>
<span>{this.props.item.email}</span>
@taiansu
taiansu / keybase.md
Created May 12, 2015 05:05
keybase.md

Keybase proof

I hereby claim:

  • I am taiansu on github.
  • I am taiansu (https://keybase.io/taiansu) on keybase.
  • I have a public key whose fingerprint is C106 EE56 DA03 DC21 EE39 E951 5511 57E2 7F47 C2EE

To claim this, I am signing this object:

@taiansu
taiansu / atomic_weight.json
Created March 27, 2015 14:38
Chemical atomic weight json
{
"H": 1.008,
"He": 4.00260,
"Li": 6.94,
"Be": 9.012182,
"B": 10.81,
"C": 12.011,
"N": 14.007,
"O": 15.999,
"F": 18.9984032,
@taiansu
taiansu / no_null_value.js
Last active August 29, 2015 14:16
null_value_checker
//var _ = require('underscore');
var goodData = {a: 1, b: 2, c: 3};
var badData = {a: null, b: 1, c: 2};
var noNullValue = function(data, checkKeys){
// check all keys unless pass an array
checkKeys = checkKeys || _.keys(data);
// will be something like [true, false, false], true means there is a null value on our checkKeys.
@taiansu
taiansu / webpack.config.js
Last active August 29, 2015 14:11
webpack config template
module.exports = {
entry: "./main.coffee",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" },
{ test: /\.coffee$/, loader: "coffee" },
@taiansu
taiansu / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
defmodule Chat.Client do
def join(server) do
client_send server, :join
end
def say(server, message) do
client_send server, { :say, message }
end
def leave(server) do
@taiansu
taiansu / about_method.rb
Last active August 29, 2015 14:04
Explaination
# puts something 等同於 puts something.to_s 所以都會自動轉字串
# p something 等同於 puts something.inspect 會印出比較詳細的資料,通常是 debug 用。
# 當你在
def method
"aaa"
end
# 等同於
def method