Skip to content

Instantly share code, notes, and snippets.

import (
"fmt"
"github.com/xiocode/rss"
"io/ioutil"
"net/http"
// "runtime"
"sync"
"time"
)
Assertions:
- I'm not stupid
- I don't want to be limited by some idiotic `people that write templates are stupid` rule.
- I don't want to learn yet another template language.
- I want to use golang expressions if, for..
- I want all the power of indexing, getting attributes and performing operations that golang offers.
- I want to type less stuff and do more.
- I want to include other templates in my template. (jinja?)
- I want to extend templates.
@xiocode
xiocode / verify.go
Created August 23, 2013 06:54 — forked from jedy/verify.go
package main
import (
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"fmt"
)
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
{
"hasvisible": false,
"marks": [],
"next_cursor": 0,
"previous_cursor": 0,
"statuses": [
{
"attitudes_count": 10,
"comments_count": 14,
@xiocode
xiocode / gist:7216296
Created October 29, 2013 15:00
zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="ys"
# Example aliases
@xiocode
xiocode / gist:7332027
Last active December 27, 2015 13:19
install postgresql 9.3.1 on centos 6
wget http://ftp.postgresql.org/pub/source/v9.3.1/postgresql-9.3.1.tar.gz
tar -xvf postgresql-9.3.1.tar.gz
yum install readline-devel zlib-devel gcc
cd postgresql-9.3.1
./configure
@xiocode
xiocode / gist:7427113
Created November 12, 2013 07:45
有用的网站
http://huoding.com/2012/01/19/142 关于timewait的解决方案
@xiocode
xiocode / gist:7596907
Last active December 29, 2015 01:59
elasticsearch settings
/etc/security/limits.conf:
* - nofile 65535
* - memlock unlimited
/etc/elasticsearch/elasticsearch.yml:
index.number_of_shards: 5
index.number_of_replicas: 0
bootstrap.mlockall: true
vi ~/.bashrc
@xiocode
xiocode / gist:7654520
Last active December 29, 2015 10:08
安装Storm框架
1、依赖Java,Python
2、安装zookeeper
wget http://apache.dataguru.cn/zookeeper/current/zookeeper-3.4.5.tar.gz
tar -xvf zookeeper-3.4.5.tar.gz
cp -R zookeeper-3.4.5 /usr/local/
ln -s /usr/local/zookeeper-3.4.5/ /usr/local/zookeeper
vi ~/.bashrc
追加:
export ZOOKEEPER_HOME="/usr/local/zookeeper"