Skip to content

Instantly share code, notes, and snippets.


Rico P RicoP

Block or report user

Report or block RicoP

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View btnd.lua
-- helper function for buttons state
-- call btn_update ONCE per update
-- btnd returns true once the button is pressed down
-- btnu returns true when the button is released
local state = {0,0,0,0,0,0}
-- call this in _update!
btn_update=function ()
for b=0,6 do
View defer.h
#define CONCAT_INTERNAL(x,y) x##y
#define CONCAT(x,y) CONCAT_INTERNAL(x,y)
template<typename T>
struct ExitScope {
T lambda;
ExitScope(T lambda):lambda(lambda){}
RicoP / strexpr.h
Created Jul 11, 2018
check string equality with const expressions [c++11]
View strexpr.h
constexpr bool constStringEquals(const char * lhs, const char * rhs) {
return (*lhs) != (*rhs)
? false
: ((*lhs) == 0
? true
: constStringEquals(lhs + 1, rhs + 1)
constexpr bool constStringEndsWith(const char * str, const char * suffix) {
RicoP / RIP.bat
Created Mar 18, 2018
Rip Audio CD with VLC
View RIP.bat
SET /a x=0
FOR /R H:\ %%G IN (*.cda) DO (CALL :SUB_VLC "%%G")
GOTO :eof
RicoP / block.js
Last active May 31, 2019
youtube mini ad block (When you don't want to use ad block, but still don't want to manually click the close button for the ad)
View block.js
// ==UserScript==
// @name youtube mini ad block
// @namespace Violentmonkey Scripts
// @grant none
// @include*
// ==/UserScript==
var started = false;
var adWholeTime = 0;
View gif2gifv.user.js
(function () {
var links = document.getElementsByTagName("a")
var regex = /*gif$/ig
for(var i = 0; i != links.length; ++i) {
var href = links[i].href;
links[i].setAttribute('href', href + "v");
RicoP / gist:7357080
Last active May 1, 2019
NES Rescources
View gist:7357080
View gist:5895145
while :
for q in bomb terror destroy
curl -A MOZILLA "$q" > /dev/null
RicoP / gist:5664550
Created May 28, 2013
Handy clang flags
View gist:5628767
$ mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
$ mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/
You can’t perform that action at this time.