Skip to content

Instantly share code, notes, and snippets.

View thapakazi's full-sized avatar
💭
🐧 🗡️ 💻

Milan Thapa thapakazi

💭
🐧 🗡️ 💻
View GitHub Profile
@thapakazi
thapakazi / presentation-tips.md
Created March 6, 2016 18:38 — forked from macintux/presentation-tips.md
Public speaking tips
@thapakazi
thapakazi / Makefile.golang
Created February 22, 2016 15:23 — forked from dnishimura/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@thapakazi
thapakazi / tmux.md
Created January 11, 2016 10:49 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@thapakazi
thapakazi / react-native-talk.md
Last active August 29, 2015 14:25 — forked from peterjmag/react-native-talk.md
Let's build a React Native app in 20 minutes - React Berlin #1
# Bash function gen_random_filename
# Description: Generates random two-word names with date appended
# Requires a dictionary file, easily generated with `aspell dump master > dictionary.txt`
# or grab it from https://gist.githubusercontent.com/ttscoff/55493fe89c35ec1588ba/raw/
# Requires shuf and aspell
#
# Example results:
# reissue_degraded-2015-03-12@0254
# Cascades_derivatives-2015-03-12@0255
# oxygens_soaked-2015-03-12@0256
#!/bin/bash
# storetime: 1:30m 2:1h 3:3h 4:6h 5:12h 6:1d 7:3d 8:7d 9:forever
# addprivacy: no:no 1:basic 2:strong 3:shorten
picpaste () {
opts=( -F storetime=1 -F addprivacy=1 -F rules=yes )
link=http://www.picpaste.com/upload.php
curl -sA firefox "${opts[@]}" -F upload=@"$1" "$link" \
| sed -n '/Picture URL/{n;s/.*">//;s/<.*//p}'
#!/bin/bash
# Script to install a ubuntu trusty tahr 14.04 LTS template on xcp or
# Citrix (TM) Xenserver 5.6 and above.
# Copyright (C) 2014 Arne-Kristian Hingst - All Rights Reserved
# Permission to copy and modify is granted under the eupl license
# http://ec.europa.eu/idabc/servlets/Docbb6d.pdf?id=31979
# Last revised 04/20/2014
#
# Add your favourite mirror here
#/etc/init/change_this_to_your_app_name.conf
description "App Name"
author "Admin Name <[email protected]>"
start on virtual-filesystems
stop on runlevel [06]
env PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:/usr/bin:/bin
env RAILS_ENV=staging # what environment