Skip to content

Instantly share code, notes, and snippets.

View RicoP's full-sized avatar
🎯
Focusing

Rico P RicoP

🎯
Focusing
View GitHub Profile
(function () {
var links = document.getElementsByTagName("a")
var regex = /imgur.com.*gif$/ig
for(var i = 0; i != links.length; ++i) {
var href = links[i].href;
if(regex.test(href))
{
links[i].setAttribute('href', href + "v");
console.log(href)
/*
* Coroutines.
*
* To make a (fake) coroutine we use these macros. A coroutine method must be static,
* return bool and needs a parameter (Generator & generator).
*
* Generator must follow this schema:
* struct Generator {
* int line;
* float time;
@RicoP
RicoP / gist:7357080
Last active May 1, 2019 00:02
NES Rescources
http://www.6502.org/tutorials/6502opcodes.html
http://www.thealmightyguru.com/Games/Hacking/Wiki/index.php?title=6502_Opcodes
http://nesdev.com/6502.txt
http://mystuffisallhere.com/blog/post/2008/08/24/Page-boundary-crossings-on-the-6502.aspx
@RicoP
RicoP / gist:5895145
Last active December 19, 2015 04:09
Hello NSA
while :
do
for q in bomb terror destroy
do
curl -A MOZILLA "https://www.google.com/search?q=$q" > /dev/null
done
done
@RicoP
RicoP / gist:5664550
Created May 28, 2013 17:35
Handy clang flags
-ffast-math
$ mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
$ mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/
@RicoP
RicoP / gist:4135474
Created November 23, 2012 12:48
Mount windows partition
sudo fdisk -l
sudo mount -t ntfs /dev/sda2 /media/windows/
@RicoP
RicoP / perfnow.js
Created November 9, 2012 13:11
JS performance timer
var perfnow = (function() {
return (
(performance && performance.now) ? function() { return performance.now(); }
: (performance && performance.webkitNow) ? function() { return performance.webkitNow(); }
: (performance && performance.mozNow) ? function() { return performance.mozNow(); }
: (performance && performance.oNow) ? function() { return performance.oNow(); }
: (Date.now) ? function() { return Date.now(); }
: function() { return +new Date(); }
)
}());
@RicoP
RicoP / advertisement.js
Created September 4, 2012 19:32
Check if browser uses an adblocker
window.usesNoAdBlocker = true;
@RicoP
RicoP / server.sh
Created June 5, 2012 10:32
simple server script
#!/bin/sh
#copy directly into /usr/bin
if [ -s /tmp/__pserver ]; then
kill `cat /tmp/__pserver`
fi
python -m SimpleHTTPServer 1>>/dev/null 2>>/tmp/log.pserver &
echo -n $! > /tmp/__pserver