Skip to content

Instantly share code, notes, and snippets.

View ma6174's full-sized avatar
🤣
/

ma6174 ma6174

🤣
/
View GitHub Profile
@ma6174
ma6174 / sort.go
Created May 11, 2015 15:19
golang map vs slice sort speed
package main
import (
"fmt"
"math/rand"
"sort"
"time"
)
type S []int
@ma6174
ma6174 / walk.go
Created March 9, 2015 19:22
walk
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"sort"
"strings"
)
@ma6174
ma6174 / code.go
Last active August 29, 2015 14:06
code server
package main
import (
"flag"
"log"
"strconv"
"net/http"
)
var code = flag.Int("c", 200, "code")
@ma6174
ma6174 / byobu.md
Created June 3, 2014 13:19
byobu快捷键

可以使用byobu代替screen,配合tmux使用

F2 创建新的窗口
shift+F2生成水平分隔
ctrl+F2生成垂直分隔
ctrl+shift+F2生成新会话
F3 回到先前窗口
F4:跳到下一个窗口
shift+F3在一个窗口的分隔中回到上一个子窗口,可循环
@ma6174
ma6174 / gist:66c8d5c39ba1369da1f6
Created June 2, 2014 14:37
修复acer笔记本ubuntu14.04开机和休眠唤醒后wifi无法自动打开问题
echo "blacklist acer_wmi" | sudo tee -a /etc/modprobe.d/blacklist.conf
@ma6174
ma6174 / 0_reuse_code.js
Created May 11, 2014 03:51
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
@ma6174
ma6174 / gist:10094894
Created April 8, 2014 05:43
mongo bson
var allItems = []testItemType{
{bson.M{},
""},
{bson.M{"_": float64(5.05)},
"\x01_\x00333333\x14@"},
{bson.M{"_": "yo"},
"\x02_\x00\x03\x00\x00\x00yo\x00"},
{bson.M{"_": bson.M{"a": true}},
"\x03_\x00\x09\x00\x00\x00\x08a\x00\x01\x00"},
{bson.M{"_": []interface{}{true, false}},
@ma6174
ma6174 / .bashrc
Last active August 29, 2015 13:57
go ack
alias fgo='find . -name "*.go" -type f | xargs -I {} grep {} ~/empty -i --color=auto -n -e '
@ma6174
ma6174 / kaoyan.py
Last active August 29, 2015 13:56
someone need it maybe~
#!/usr/bin/env python
# coding=utf-8
import urllib
import BeautifulSoup
import sys
import Queue
import threading
import logging
@ma6174
ma6174 / rename_music.py
Created January 18, 2014 13:57
rename music using titie and artist
#!/usr/bin/env python
# coding=utf-8
import os
from mutagen.mp3 import MP3
from mutagen.easyid3 import EasyID3
dir = "/home/ma6174/Music/"
for i in os.listdir(dir):
real_path = dir + i
id3info = MP3(real_path, ID3=EasyID3)