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 / RIP.bat
Created March 18, 2018 13:05
Rip Audio CD with VLC
@ECHO OFF
setlocal ENABLEDELAYEDEXPANSION
SET /a x=0
FOR /R H:\ %%G IN (*.cda) DO (CALL :SUB_VLC "%%G")
GOTO :eof
:SUB_VLC
(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)
@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 / 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 / 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~