Skip to content

Instantly share code, notes, and snippets.

View madr's full-sized avatar
🤘
Elixir, React, Phoenix Liveview, Rust.

Anders Englöf Ytterström madr

🤘
Elixir, React, Phoenix Liveview, Rust.
View GitHub Profile
@Arood
Arood / watch
Created April 21, 2013 20:11
Watches for changes in JavaScript and Sass-folders
#!/bin/sh
JS_PATH="_js"
FINAL_JS="scripts.js"
SASS_PATH="_sass"
FINAL_CSS="."
sha=0
previous_sha=0
@madr
madr / site.less
Last active February 14, 2016 14:54
LESS boilerplate
/*csslint box-model: false, box-sizing: false, universal-selector: false */
/*
All projects
should have nice
ASCII ART!
http://patorjk.com/software/taag/
@madr
madr / characters.js
Last active December 25, 2015 14:19
var ಠ_ಠ = eval,
ლ_ಠ益ಠ_ლ = 42,
λ = function() {},
oneQuarter = "¼",
oneHalf = "½",
threeQuarters = "¾";
// ☺
// ¯\_(ツ)_/¯
// ಠ~ಠ
@EmilHernvall
EmilHernvall / proxy.py
Last active October 17, 2023 20:30
Transparent proxy for rewriting web pages to include The Hoff
"""
Install twisted (pip install twisted) and PIL (pip install PIL), and run the script.
On your gateway, run the following commands:
iptables -t nat -A PREROUTING -i br0 -s ! 192.168.0.20 -p tcp --dport 80 -j DNAT --to 192.168.0.20:8080
iptables -t nat -A POSTROUTING -o br0 -s 192.168.0.0/24 -d 192.168.0.20 -j SNAT --to 192.168.0.1
iptables -A FORWARD -s 192.168.0.0/24 -d 192.168.0.20 -i br0 -o br0 -p tcp --dport 8080 -j ACCEPT
Substitute 192.168.0.20 for the computer running the proxy.
"""