Skip to content

Instantly share code, notes, and snippets.

View RicoP's full-sized avatar
🎯
Focusing

Rico P RicoP

🎯
Focusing
View GitHub Profile
@RicoP
RicoP / smc.sh
Created January 18, 2012 13:10
SMC bash
#/bin/bash
java -jar ~/apps/smc_6_1_0/bin/Smc.jar $@
FILE=$_
if [[ "$@" == *-js* ]]
then
NAME="${FILE%%.*}"
SM="${NAME}_sm.js"
sed 's/\/\/# No actions.//g' $SM > $SM~
java -jar ~/apps/closure-compiler/compiler.jar --js $SM~ --js_output_file $SM --formatting PRETTY_PRINT --compilation_level WHITESPACE_ONLY
rm $SM~
@RicoP
RicoP / loop.c
Created April 20, 2012 15:38
Quickloop
#include <stdio.h>
#define repeat(VAR,TO,ACTION) \
{ \
int VAR = 0; \
switch((TO) % 8) { \
while(VAR != (TO)) { \
ACTION; VAR++; \
case 7: \
ACTION; VAR++; \
@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
@RicoP
RicoP / advertisement.js
Created September 4, 2012 19:32
Check if browser uses an adblocker
window.usesNoAdBlocker = true;
@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 / gist:4135474
Created November 23, 2012 12:48
Mount windows partition
sudo fdisk -l
sudo mount -t ntfs /dev/sda2 /media/windows/
$ mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
$ mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/
@RicoP
RicoP / gist:5664550
Created May 28, 2013 17:35
Handy clang flags
-ffast-math
@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: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