Skip to content

Instantly share code, notes, and snippets.

View ReeseWang's full-sized avatar

Ruoxi Wang ReeseWang

View GitHub Profile
@jasonwhite
jasonwhite / joystick.c
Last active September 17, 2024 05:52
Reads joystick/gamepad events on Linux and displays them.
/**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run:
@KonradIT
KonradIT / Hero4BlackWifi.md
Last active March 15, 2023 15:15
Wifi hacking for HERO4 Black
@kachayev
kachayev / dijkstra.py
Last active July 28, 2024 13:10
Dijkstra shortest path algorithm based on python heapq heap implementation
from collections import defaultdict
from heapq import *
def dijkstra(edges, f, t):
g = defaultdict(list)
for l,r,c in edges:
g[l].append((c,r))
q, seen, mins = [(0,f,())], set(), {f: 0}
while q:
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@vgarvardt
vgarvardt / copy_sqlite_db.py
Created August 6, 2012 09:49
Copy tables structure and data from one sqlite database file to another
#!/usr/bin/env python
import os
import argparse
import sqlite3
import logging
try:
# tornado is bundled with pretty formatter - try using it
from tornado.options import enable_pretty_logging
enable_pretty_logging()