Skip to content

Instantly share code, notes, and snippets.

@ihsansatriawan
ihsansatriawan / 00_etc-hosts.md
Created November 28, 2018 11:25 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo, Netflix, Reddit, and Imgur.

Unblock Vimeo, Netflix, Reddit, dan Imgur

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

Tambahkan list di bawah ke %System32%\Drivers\etc\hosts

@ihsansatriawan
ihsansatriawan / anagram.js
Created June 7, 2018 04:41
Check if two string are anagram using Javascript
let anagram = (s1, s2) =>
s1.split('').sort().join('') === s2.split('').sort().join('')

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@ihsansatriawan
ihsansatriawan / gist:fad6960505a94a8620bac620ee26dae3
Created May 18, 2018 00:03 — forked from leetreveil/gist:1092829
Change the author of a specific commit (git)
git filter-branch -f --env-filter 'if [[ "$GIT_COMMIT" = "119900cd7054c64f2b8e4774e59afbfc39a28e73" ]]; then export GIT_COMMITTER_NAME="Lee Treveil" GIT_AUTHOR_NAME="Lee Treveil" GIT_COMMITTER_EMAIL="leetreveil@gmail.com" GIT_AUTHOR_EMAIL="leetreveil@gmail.com"; fi' HEAD
@ihsansatriawan
ihsansatriawan / Zsh & theme
Created May 28, 2017 20:16 — forked from leemour/Zsh & theme
Zsh installation and Agnoster theme settings
# Railscast
http://railscasts.com/episodes/308-oh-my-zsh
# Install Zsh
sudo apt-get update && sudo apt-get install zsh
# Install Oh-my-zsh
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh
# Make ZSH default shell
#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
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 = {}