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 " be iMproved, required | |
" #set backspace=indent,eol,start | |
filetype off " required | |
nnoremap <BS> X | |
set backspace=indent,eol,start | |
set nu | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins |
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
# ~/.tmuxinator/kafka.yml | |
name: kafka | |
root: ~/dev/confluent/confluent-3.2.0 | |
attach: false | |
windows: | |
- zookeeper: './bin/zookeeper-server-start ./etc/kafka/zookeeper.properties' | |
- server: | |
- sleep 3 | |
- './bin/kafka-server-start ./etc/kafka/server.properties' |
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 ( | |
"bytes" | |
"image" | |
"image/gif" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"sort" |
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 ( | |
"fmt" | |
"log" | |
"net/http" | |
"golang.org/x/net/html" | |
) |
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
/* | |
Design a Rate Printer | |
The printer reads from a file | |
The printer writes to a file | |
Print the Bytes/Second at which the printer is printing every second | |
*/ | |
package main | |
import ( | |
"fmt" |
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
def deserialize(input) | |
h = {} | |
l = 0 | |
stack = [] | |
curr_string = "" | |
while l < input.length do | |
case input[l] | |
when "{" #state = DICT_START | |
curr_string = "" | |
when ":" #state = VALUE_START |
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 ( | |
"fmt" | |
"math/rand" | |
"os" | |
"regexp" | |
"strconv" | |
"strings" | |
) |
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
gore> a:=[]int{1,2,3} | |
[]int{1, 2, 3} | |
gore> println(a) | |
[3/3]0xc420041f20 | |
gore> b:=[3]int{1,2,3} | |
[3/3]0xc420041ef8 | |
[3]int{1, 2, 3} | |
gore> println(b) | |
# command-line-arguments | |
/var/folders/r0/xqky0mq5773d6bc44pk_xfb00000gp/T/705406632/gore_session.go:10: illegal types for operand: print |
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 ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/gif" | |
"image/jpeg" | |
"image/png" | |
"math/rand" |
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
a =[{n: 1}, {n: 5}, {n: 3}] | |
a.sort {|x,y| x[:n]<=>y[:n] } #=> [{:n=>1}, {:n=>3}, {:n=>5}] | |
a.sort_by{|x| x[:n].to_i } #=> [{:n=>1}, {:n=>3}, {:n=>5}] |