Skip to content

Instantly share code, notes, and snippets.

#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
look process:
`lsof -i :<PORT NUMBER>
kill process
`kill -9 <PID>`
@ihsansatriawan
ihsansatriawan / tmux-cheatsheet.markdown
Created February 1, 2017 02:43 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
git branch -d branch_name #local
git push origin --delete <branch_name>
#!/bin/sh
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit
# chmod +x pre-commit
#
# Based on
class ClusteringQuality:
"""
Instances of this class implement the two measures of clustering quality discussed in the article, namely the davies
bouldin index and the silhouette index. It also implements a number of useful helper methods.
:param solution: the clustering solution of type Clustering
:param minimum: the minimum distance allowable
"""
def __init__(self, solution, minimum):
"""
@ihsansatriawan
ihsansatriawan / DistanceMetrics.py
Created March 21, 2016 07:05 — forked from StuartGordonReid/DistanceMetrics.py
Implementation of various distance metrics in Python
import math
import random
import csv
import cProfile
import numpy as np
import hashlib
memoization = {}
@ihsansatriawan
ihsansatriawan / book_reco.py
Created March 21, 2016 06:34 — forked from mickaellegal/book_reco.py
Python: Blog Pearson correlation coefficient for book reviews
# Importing the libraries
from scipy.stats.stats import pearsonr
import pandas as pd
import numpy as np
import json
data = pd.read_csv("../../Downloads/data_books.csv", sep = ",", header=None,
names=['Reviewer', 'Book', 'Rating'])
# Picking 2 books
After setting up your layout, right-click on any terminal background and choose Preferences → Layouts tab and click on Add button.
Give it a name and hit Close.
This should create the mentioned ~/.config/terminator/config file.
Now you can start terminator using the saved layout using: terminator -l yourLayout (replace yourLayout with whatever you chose on step 2).
(optional) Edit the ~/.config/terminator/config file so that where it says [layouts] and nested below it [[yourLayout]], rename yourLayout to default and remove/rename the previous default layout. Now, when Terminator starts without any parameters, it will load your custom [[default]] layout!