Skip to content

Instantly share code, notes, and snippets.

View gaybro8777's full-sized avatar
💭
Im not gay. I'm just getting back at my dad for not getting me an xbox

Michael Corrado gaybro8777

💭
Im not gay. I'm just getting back at my dad for not getting me an xbox
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gaybro8777
gaybro8777 / ttf2woff2.md
Created April 4, 2018 19:14 — forked from sergejmueller/ttf2woff2.md
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@gaybro8777
gaybro8777 / pid.js
Created May 24, 2018 01:43 — forked from FGRibreau/pid.js
Simple snippet for cross-platform .pid management in NodeJS. I use it for managing NodeJS apps with supervisord and monit
//
// Usage: require('./pid')("myapp");
//
var fs = require('fs');
module.exports = function(appname){
process.title = appname;
var PID_FILE = "/usr/local/var/run/"+process.title+".pid";
$('#el').AttributeObserver(attr, callback, [delay]);
if(!function_exists('apc_exists')){
function apc_exists($keys){
$r;
apc_fetch($keys,$r);
return $r;
}
}
@gaybro8777
gaybro8777 / underscore_template_err.js
Created May 24, 2018 10:37 — forked from FGRibreau/underscore_template_err.js
Add the following code just after UnderscoreJS declaration to find where _.template calls are run against empty templates.
/**
* Add the following code just after UnderscoreJS declaration to find
* where _.template calls are run against empty templates.
*/
(function(old){
_.template = function(str, data) {
if(!str){
console.error("Could not load template", new Error().stack);
@gaybro8777
gaybro8777 / table.filter.lua
Created May 24, 2018 10:37 — forked from FGRibreau/table.filter.lua
Lua table.filter (JavaScript Array::filter equivalent)
-- table.filter({"a", "b", "c", "d"}, function(o, k, i) return o >= "c" end) --> {"c","d"}
--
-- @FGRibreau - Francois-Guillaume Ribreau
-- @Redsmin - A full-feature client for Redis http://redsmin.com
table.filter = function(t, filterIter)
local out = {}
for k, v in pairs(t) do
if filterIter(v, k, t) then out[k] = v end
end
@gaybro8777
gaybro8777 / hash_range.js
Created May 24, 2018 10:38 — forked from FGRibreau/hash_range.js
My yesterday night 1 hour code rush: JavaScript Hash with Range-based keys
/**
* September 20 night: 1 hour code rush
* @FGRibreau
*
* Requirements
* ------------
* The aim of this code rush is to enable developers to define a "range hash map"
* in a very expressive way (without if/then/else).
*
* Data-set
@gaybro8777
gaybro8777 / console_patch.js
Created May 24, 2018 10:39 — forked from FGRibreau/console_patch.js
Add timestamp information to the JavaScript console
/**
* Patch the console methods in order to provide timestamp information
*
* Usage:
* > console.log('ok')
* 2012-09-06T11:52:56.769Z ok true
*
* Note:
* The patch will only be applied with the first call.
*