Skip to content

Instantly share code, notes, and snippets.

View Kelvinson's full-sized avatar
💭
This cat is googling and stackoverflowing~

Dong W Kelvinson

💭
This cat is googling and stackoverflowing~
  • Somewhere
View GitHub Profile
@Kelvinson
Kelvinson / robotics.md
Created May 1, 2019 14:10 — forked from UsmanMaqbool/robotics.md
Robotics Installation

Installation Guide

OPENCV

OpenCV 2.4.13

To install

cd ~
@Kelvinson
Kelvinson / System Design.md
Created January 23, 2019 00:11 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
import argparse
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torchvision
import torchvision.transforms as T
from torchvision.datasets import ImageFolder
@Kelvinson
Kelvinson / tmux-cheatsheet.markdown
Created August 31, 2018 01:20 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Kelvinson
Kelvinson / pairSwap.cpp
Created June 21, 2018 22:56
C++ Pointer to Pointer
// the solution by StefanPochmann https://leetcode.com/problems/swap-nodes-in-pairs/discuss/11019/7-8-lines-C++-Python-Ruby
ListNode* swapPairs(ListNode* head) {
ListNode **pp = &head, *a, *b;
while ((a = *pp) && (b = a->next)) {
a->next = b->next;
b->next = a;
*pp = b;
pp = &(a->next);
}
return head;
@Kelvinson
Kelvinson / rename.sh
Created May 5, 2018 13:37
rename the file in the current directory by adding index to the file name
index=1
# ls -rt means list in the order of oldest first
for i in $(ls *.pdf -rt)
do
cp "${i}" "${index}_${i}"
index=$((index+1))
done
#!/usr/bin/env python
"""
Download all the pdfs linked on a given webpage
Revised from the original author elssar's gist (https://gist.github.com/elssar/5160757) to scrap the pdf links in piazza resources
tab, the original script is for the websits don't need login. But you have
to login piazza to scape the contents. So I revised the request.post with
authentification info and turn the program to run with Python3
Usage -
python grab_pdfs.py url <path/to/directory>
@Kelvinson
Kelvinson / Install NVIDIA Driver and CUDA.md
Created April 17, 2018 22:25 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS