Skip to content

Instantly share code, notes, and snippets.

View lujiacn's full-sized avatar

JL lujiacn

  • earth
  • earth
  • 19:32 (UTC +08:00)
View GitHub Profile
@lujiacn
lujiacn / reflection.go
Created September 23, 2015 05:23 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@lujiacn
lujiacn / docker.sh
Created October 13, 2015 06:46 — forked from nsisodiya/docker.sh
Upgrade to Docker 1.8 on ubuntu box
sudo su
echo deb https://apt.dockerproject.org/repo ubuntu-`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d'=' -f2` main >> /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D
apt-get update
apt-get purge lxc-docker*
apt-get purge docker.io*
apt-get install docker-engine
exit
@lujiacn
lujiacn / 0_reuse_code.js
Created October 16, 2015 06:41
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
@lujiacn
lujiacn / install-tmux
Created October 18, 2015 05:29 — forked from rothgar/install-tmux
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@lujiacn
lujiacn / Go Revel nginx.conf
Created October 22, 2015 09:23 — forked from tim-peterson/Go Revel nginx.conf
Revel Framework nginx.conf to make Revel app work outside of localhost, i.e., on my live, personal-website.com
http{
index index.html;
server {
listen 80;
root /gocode/src/personalwebsiteapp;
server_name personal-website.com;
package controllers
import (
"encoding/base64"
"errors"
"github.com/robfig/revel"
"net/http"
"strings"
)
@lujiacn
lujiacn / start-rserve.sh
Last active August 9, 2016 02:51 — forked from erochest/start-rserve.sh
A simple shell script to start Rserve.
#without output
R -e 'library(Rserve); Rserve(args="--vanilla")' 2>&1 > /dev/null
@lujiacn
lujiacn / current-dir-in-iterm-tab-title.sh
Created October 18, 2016 10:05 — forked from phette23/current-dir-in-iterm-tab-title.sh
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@lujiacn
lujiacn / sendMail.go
Created January 29, 2017 11:58 — forked from andelf/sendMail.go
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"
@lujiacn
lujiacn / Monaco for Powerline.md
Created October 25, 2017 15:03 — forked from ymjing/Monaco for Powerline.md
Powerline-patched Monaco for Windows and OSX

Powerline-patched Monaco for Windows and OSX

This font is manually patched with Fontforge. It includes the glyphs from DejaVu Sans Mono for Powerline.

I recommend DirectWrite-patched VIM builds. I'm using KaoriYa's build (http://www.kaoriya.net/software/vim/)

Usage

Add the following lines to your .vimrc/_vimrc: