Skip to content

Instantly share code, notes, and snippets.

@buddhike
buddhike / gist:45d222be7e40274166ff
Created April 22, 2015 17:08
Static Using Example
using System.Console;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Write("Yo");
}
@buddhike
buddhike / 0_reuse_code.js
Last active August 29, 2015 14:28
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
@buddhike
buddhike / .vimrc
Last active March 4, 2018 10:43
vim setup
set nocompatible " be iMproved, required
filetype off " required
let g:ctrlp_custom_ignore = '\v[\/](node_modules|jspm_packages|target|dist|vendor)|(\.(swp|ico|git|svn))$'
let g:airline#extensions#tabline#enabled = 1
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
{
"name": "TODO",
"version": "0.0.1",
"description": "TODO",
"author": "TODO",
"license": "MIT",
"main": "dist/index.js",
"scripts": {
"build": "babel lib/ -d dist/ --source-maps",
"eslint": "eslint src",
@buddhike
buddhike / ubuntu-symbols.sh
Created October 30, 2016 21:41
Setup debug symbols for Ubuntu 16.x.
#!/usr/bin/sh
# Debug symbols setup for Ubuntu 16.x
sudo -i
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-security main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | \
tee -a /etc/apt/sources.list.d/ddebs.list
@buddhike
buddhike / linux-cheet-sheet.sh
Last active November 16, 2016 12:31
Useful linux commands
# Find linux distro details
## This info is generally available in os-release or lsb-release files.
cat /etc/*-release
## Alternatively we can use the lab_release command
lsb_release -a
@buddhike
buddhike / code.json
Last active April 27, 2017 09:58
VS Code Config
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Menlo",
"editor.fontSize": 15,
"javascript.validate.enable": false,
"window.reopenFolders": "none",
"editor.renderWhitespace": "none",
"editor.renderIndentGuides": true,
"editor.rulers": [
80,
@buddhike
buddhike / dockerfile-goapp
Last active May 11, 2017 20:48
Go app template with dumb-init
FROM centos
ENV DOWNLOADS /home/downloads
ENV TOOLS /home/tools
ENV GOROOT $TOOLS/go
ENV GOPATH /home/go
ENV PATH $GOROOT/bin:$PATH
ENV APP [APP-NAME]
ADD . /home/go/src/$APP
@buddhike
buddhike / dockerfile-gotoolchain
Last active May 12, 2017 22:00
Container with go toolchain.
# Container with go toolchain.
# Create a directory in host and map it to /go volume to persist data between
# multiple commands.
# Usage:
# docker build -t go
# docker run --rm -v [dir-in-host]:/go -v $GOPATH/src/app:/go/src/app go get app
# docker run --rm -v [dir-in-host]:/go -v $GOPATH/src/app:/go/src/app go test app
# docker run --rm -v [dir-in-host]:/go -v $GOPATH/src/app:/go/src/app go build -o app/build/out app
#
FROM centos
@buddhike
buddhike / hugo_deploy.sh
Created June 10, 2017 08:56
hugo deployment
#!/bin/sh
set -e
DIR=$(dirname "$0")
if [[ $(git status -s) ]]
then
echo "The working directory is dirty. Please commit any pending changes."
exit 1;