Skip to content

Instantly share code, notes, and snippets.

View nickylimjj's full-sized avatar
💭
loves itacho sushi

Nicky Lim nickylimjj

💭
loves itacho sushi
View GitHub Profile
" .vimrc
" vim configuration file
" Created by Nicky Lim
syntax enable
filetype plugin indent on
set number
set rnu
set colorcolumn=81
highlight CursorLine ctermbg=Black
# .bash_aliases
# Useful commands for the terminal
# Created by Nicky Lim
# some references from
## https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
############################
# Useful in-built commands #
############################
@nickylimjj
nickylimjj / .tmux.conf
Last active May 15, 2020 02:31
tmux conf file
# .tmux.conf
# tmux configuration file
# Created by NICKY LIM
# prefix t puts the timer on
# prefix ? shows help
unbind %
unbind '"'
@nickylimjj
nickylimjj / Makefile
Last active December 18, 2019 00:55
Sample makefile from .s -> bin
AS := as
LD := ld
SRC := $(wildcard *.s)
OBJ := $(patsubst %.s, %.o, $(SRC))
BIN := $(patsubst %.o, %, $(OBJ))
.PHONY: all
all: $(BIN)
@nickylimjj
nickylimjj / scapy-quickstart.py
Created December 4, 2019 14:49
[scapy] quickstart guide to parse pcaps
#!/usr/bin/env python3
from scapy.all import *
filename = "capture.pcap"
pcap = rdpcap(filename)
result = ''
for p in pcap[TCP]:
def b ():
print( myvar )
def a ():
myvar = 'a'
b()
myvar = 'outer'
a() # will print 'outer' because it looks down the scope chain, NOT execution / stack trace
m = {}
def foo(regex, s_list):
for idx, token in enumerate(regex):
# set token and ensure unique values
if (token not in m and
s_list[idx] not in m.values()):
m[token] = s_list[idx]
# fails if token not added (bcoz substring not unique) or
@nickylimjj
nickylimjj / checkImpementation
Created November 20, 2017 12:43
Python list Implementation
$ python -m timeit --setup="x = [None]*1000" "x[500]"
10000000 loops, best of 3: 0.0579 usec per loop
$ python -m timeit --setup="x = [None]*1000" "x[0]"
10000000 loops, best of 3: 0.0566 usec per loop
@nickylimjj
nickylimjj / nric-cert.py
Last active June 15, 2017 15:49
nric-cert.py
# nric-cert.py
# verifies a Singaporean NRIC
# motivated by video from The Fun Social - How did your NRIC
# number come about?
# date created: June 15, 2017
# author: Nicky Lim
import sys
assert len(sys.argv) == 2, "Usage: python nric-cert.py <NRIC>"
@nickylimjj
nickylimjj / hackillinois2017.md
Last active February 26, 2017 19:32
DevPost submission for hack illinois 2017

Hack Illinois 2017

First Open Source contribution to Jupyter

About

Project Jupyter was born out of the IPython Project in 2014 as it evolved to support interactive data science and scientific computing across all programming languages.

My Work

Started with a introduction by Katy Huff to figure out the technicalities of submitting a pull request to the actual copy.(arfc/hipython#2).

Subsequently, I tried my hands on the jupyter project. I identified a beginner friendly issue with Jupyter notebook (http://jupyter.org/) which I could start with. It involved reading several issues and the codebase to identify the problem and making the necessary changes.

The issue was a bugfix in nb and server extensions where server extensions were not loaded when installed to different locations. (jupyter/notebook#2063) The solution was solved by modifiying to load with Config Manager so that the merge happens recursively by minrk (https://github.com/jupyter/noteb