Skip to content

Instantly share code, notes, and snippets.

@bamoo456
bamoo456 / fibonacci.go
Created February 17, 2016 02:41
Exercise: Fibonacci closure
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
idx, beforeLastN, lastN := 0, 0, 1
return func() int {
if (idx == 0) {
@bamoo456
bamoo456 / Front-end-Developer-Interview-Questions-TC.md
Created November 20, 2015 01:34 — forked from hanksudo/Front-end-Developer-Interview-Questions-TC.md
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@bamoo456
bamoo456 / snippet.md
Last active August 29, 2015 14:14 — forked from harthur/snippet.md

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
 }
/**
* @Author: George_Chen
* @Description: get the union of two array
*
* @param {Array} arr1, an basic array including some elements
* @param {Array} arr2, an basic array including some elements
*/
function __getArrayUnion(arr1, arr2) {
var union = {};
var len = (arr1.length > arr2.length) ? arr1.length : arr2.length