Skip to content

Instantly share code, notes, and snippets.

View linktohack's full-sized avatar

Quang-Linh LE linktohack

View GitHub Profile
linktohack / subr
Created January 16, 2015 10:34
Download rmate as subr (and subl if not exist)
wget -O /usr/local/bin/subr
chmod +x /usr/local/bin/subr
if ! which subl 2>&1 > /dev/null; then
ln -s /usr/local/bin/subr /usr/local/bin/subl
linktohack / hackerWeb.js
Last active August 29, 2015 14:14
HackerWeb (bookmarklet) redirect for HackerNews frontend
javascript:(function hackerWeb (len) {
if (window.location.href.match('')) {
window.location.href = window.location.href.replace('', '');
} else {
var a = document.querySelectorAll('a');
if (len != a.length) {, function(e) {
var href = e.getAttribute('href');
href && e.setAttribute('href', href.replace('', ''));
linktohack / gender.txt
Last active August 29, 2015 14:15
Hao gender equality
Emma Watson seems nervous at first, but I can see coherence in her speech. She starts with her own experience with her family, her school then her confession of a feminist with her male friend then to a bigger picture: Human rights, where people, men an women perceive the same rights, same opportunities in their life.
As she stated in her speech, no country at the moment achieves gender equality and it doesn't seem to change much from the talk of Hilary Clinton in 1997. She also mentions that it maybe due to the fact that there was too few men who participate the campaigns.
Having a look on the map of HeForShe, I found however, the more men's votes in US and Europe, the less votes on Africa. Is this the answer why do we have Angela Merkel as Chancellor of Germany or Marissa Mayer as CEO of Yahoo! when here are many women out there doing the job no men do in Jordan or even having no ID card in Guatemala?
linktohack / fortran-ampersand.el
Last active August 29, 2015 14:15
fortran insert continuation symbol (ampersand &) that match both fixed and free format.
(defun fortran-insert-f90-continuation ()
"Insert continuation symbol (ampersand &) that match both fixed and
free format.
If the inserted ampersand is the first non-blank character, just
insert it, otherwise, insert it at column 72 (zero-based index)
and insert another ampersand at column 6 on next line.
Also indent next line if `electric-indent-mode` is on."
linktohack / zshrc
Last active August 29, 2015 14:16
tor and socks proxy alias for OS X
function t () {
sudo networksetup -setsocksfirewallproxy $INTERFACE 9050 off
sudo networksetup -setsocksfirewallproxystate $INTERFACE on
if ! [ -z $1 ]; then
mv /usr/local/etc/tor/torrc{,.t} 2>&1 > /dev/null
echo "ExitNodes {$1}" | tee /usr/local/etc/tor/torrc
if ! [ -z $1 ]; then
linktohack / PIV.F90
Last active August 29, 2015 14:17
fortran careful with implicit...
UU = UU + U(:,:,IPIV)**2
VV = VV + V(:,:,IPIV)**2
UV = UV + U(:,:,IPIV)*V(:,:,IPIV)
linktohack / dura.js
Last active August 29, 2015 14:17
filter link to download
console.log((function (match) {
a = document.querySelectorAll('a');
matched = [], function (e) { return e.innerText.match(match); });
link = (e) { return window.location.href + e.getAttribute('href'); });
return link.join("\n");
linktohack /
Created March 30, 2015 08:09
git gc everything
git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc
linktohack / horri.js
Last active August 29, 2015 14:19
HorribleSubs all magnet links
[]'div.latest a'), function(e) {
return /^magnet/.test(e.getAttribute('href'));
}).filter(function(e) {
return /720p/.test(e.parentNode.parentNode.parentNode.innerText);
}).map(function (e) {
return e.getAttribute('href');
linktohack / .spacemacs.el
Created April 19, 2015 21:59
Emacs reset default theme
(mapc 'disable-theme custom-enabled-themes)