Skip to content

Instantly share code, notes, and snippets.

View me7's full-sized avatar

Gampol T. me7

  • Thailand
View GitHub Profile
@me7
me7 / readline.go
Last active August 29, 2015 14:18
Process text file. One line at a time. Python is 45% shorter (19 vs 34 line) but go run 25% faster (1.23 vs 1.70 second on 500,000 line file). But I prefer go because easier distribute (build exe file)
package main
import (
"fmt"
"bufio"
"os"
"regexp"
"strings"
"time"
)
@me7
me7 / tipgodoc
Created April 16, 2015 10:58
tip.golang.org from hacking with andrew and brad
//
//
//
package main
import (
"bufio"
"encoding/json"
"flag"
@me7
me7 / DirWalk.go
Created April 23, 2015 02:56
walk directory and read file content to array of strings
package main
import (
"fmt"
"path/filepath"
"os"
"io/ioutil"
"strings"
)
@me7
me7 / gist:15ce46c9b5c8c3af6c9b
Created April 27, 2015 04:29
Build go from source log
##### Building Go bootstrap tool.
cmd/dist
##### Building Go toolchain using /usr/local/go.
##### Building compilers and go_bootstrap for host, linux/amd64.
##### Building packages and commands for linux/amd64.
Show samba version
samba -V
Change samba password for current user
smbpasswd
Test samba.conf after edit
testparm
Test connect to samba share (Linux side)
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": false,
"animation_enabled": true,
"atomic_save": false,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_cycle": false,
"auto_complete_delay": 50,
@me7
me7 / brogrammer.tmTheme
Created May 13, 2015 07:47
Sublime Theme Settings - Add guide, activeGuide and stackGuide to Brogrammer theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Brogrammer</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
[
{ "keys": ["shift+space"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
]
@me7
me7 / Gosublime.sublime-settings
Created May 13, 2015 10:00
Gosublime Settings
{
"fmt_cmd": ["goimports"],
"autocomplete_snippets": true,
"autocomplete_builtins": true,
"autocomplete_closures": true,
"autocomplete_suggest_imports": true,
"use_named_imports": true,
"default_snippets": [
{
"match": {"global": true, "pkgname": "."},
@me7
me7 / .gitconfig
Last active August 29, 2015 14:21
Sublime Settings
[user]
name = \"kittys\"
email = \"xxxxx@gmail.com\"
[push]
default = matching
[github]
user = kittys
token =