Skip to content

Instantly share code, notes, and snippets.

View gravataLonga's full-sized avatar
🤓
Zig Nerding

Jonathan Fontes gravataLonga

🤓
Zig Nerding
View GitHub Profile
@gravataLonga
gravataLonga / apache-webp-rewrite.conf
Created December 20, 2017 12:46 — forked from seeekr/apache-webp-rewrite.conf
enabling apache to serve WebP image files if accepted by browser (and .webp files available)
# originally from https://groups.google.com/a/webmproject.org/group/webp-discuss/browse_thread/thread/196ac4ea705688d8
<IfModule mod_rewrite.c>
# TODO: don't forget to put
# AddType image/webp .webp
# in your mods-available/mime.conf
# (though this is optional because we're setting
# the mime type manually in the RewriteRule)
# Enable rewrite
@gravataLonga
gravataLonga / 0_reuse_code.js
Created June 5, 2017 09:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
define ("SERIAL_DEVICE_NOTSET", 0);
define ("SERIAL_DEVICE_SET", 1);
define ("SERIAL_DEVICE_OPENED", 2);
/**
* Serial port control class
*
* THIS PROGRAM COMES WITH ABSOLUTELY NO WARANTIES !
* USE IT AT YOUR OWN RISKS !
function emptySet(x) {
return false;
}
function insert(elem, set) {
return function(x) {
if (x === elem) { // insert smarter comparison here if needed
return true;
}
return function() { return contains(x, set); };