Skip to content

Instantly share code, notes, and snippets.

@pantaluna
pantaluna / CSS
Created September 11, 2015 17:24
videojs auto-resize
/* Add extra classes for a variable width / height*/
#div-video-wrapper {
position: relative;
background-color: #000;
border-radius: 5px;
box-shadow: 0 0 20px rgba(50, 50, 50, 0.95);
border: 2px #ccc solid;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
### RHMOD Modded Oct2014.
# VCL compiler : this VCL is compatible with the new 4.0 format.
vcl 4.0;
sub mobile_detect {
#Based on Mobile-Detect 2.8.17 # https://github.com/serbanghita/Mobile-Detect
@pantaluna
pantaluna / Gruntfile.js
Created April 1, 2016 20:25
Gruntfile.js of bootstrap-4.0.0-alpha.2
grunt - build - control
/*!
* Bootstrap's Gruntfile
* http://getbootstrap.com
* Copyright 2013-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
module.exports = function (grunt) {
'use strict';
let getGraphChecklistById = Promise.coroutine(function*(pId) {
console.log('> getGraphChecklistById()');
let checklist = yield getChecklistById(pId);
checklist.__node__ChecklistItemGroups = yield fetchChecklistItemGroupsByChecklistId(pId); // Returns a promise.
for (let pItem of checklist.__node__ChecklistItemGroups) {
pItem.__node__ChecklistItems = yield fetchChecklistItemsByXrefId(pItem.xchlclig_id);
}
return checklist;
});
<?
require("redis.php");
require("json.php");
$term = $_GET['term'];
$r = new Redis("127.0.0.1","6379");
$r->connect();
$items = $r->zrangebylex("kernel","[$term","[$term\xff",Array("LIMIT","0","10"));
@pantaluna
pantaluna / Cygwin bash
Created September 28, 2016 21:14
SlimerJS page.papersize = Object
#CYGWIN>>
cd /cygdrive/c/myhtdocs/fdb-calendar-feature/calendar-image-generator
export SLIMERJSLAUNCHER="/cygdrive/c/Program Files (x86)/Mozilla Firefox/firefox.exe"
rm --verbose output-papersize*
slimerjs-0.10.0/slimerjs -debug yes dev-slimerjs-papersize.js 3507 2481 true output-papersize http://www.feestdagen-belgie.be/kalender
@pantaluna
pantaluna / modsecurity_crs_10_setup.conf.sh
Created November 20, 2016 12:13
Apache modsecurity_crs_10_setup.conf - Add HTTP/2.0 to the list of allowed http versions
# ***SPECIAL*** Add HTTP/2.0 to the list of allowed http versions
# Fixes the modsecurity error [id "960034"] [rev "2"] [msg "HTTP protocol version is not allowed by policy"] [data "HTTP/2.0"]
MYSCRIPT="/usr/share/modsecurity-crs/modsecurity_crs_10_setup.conf"
SEARCHTHIS="'tx.allowed_http_versions=HTTP/0.9 HTTP/1.0 HTTP/1.1'"
REPLACEWITH="'tx.allowed_http_versions=HTTP/0.9 HTTP/1.0 HTTP/1.1 HTTP/2.0'"
sed --in-place "s#${SEARCHTHIS}#${REPLACEWITH}#" ${MYSCRIPT}
grep --ignore-case "${REPLACEWITH}" ${MYSCRIPT} || echo "ERROR: the text has NOT been REPLACED!"
add-apt-repository "deb http://pkg.ci.collectd.org/deb trusty collectd-5.7"
gpg --recv-keys 3994D24FB8543576
gpg --export -a 3994D24FB8543576 | apt-key add -
apt-get update
apt-show-versions | egrep --ignore-case "collectd"
#OUTPUT#:
collectd:amd64/trusty 5.6.2.5.g1afa5e0-1~trusty upgradeable to 5.7.0.15.gbe6aa28-1~trusty
collectd-core:amd64/trusty 5.4.0-3ubuntu2 upgradeable to 5.7.0.15.gbe6aa28-1~trusty
collectd-utils:amd64/trusty 5.6.2.5.g1afa5e0-1~trusty upgradeable to 5.7.0.15.gbe6aa28-1~trusty
@pantaluna
pantaluna / main.c
Last active January 31, 2018 10:53
/*
* MJD HARDWARE INSTRUCTIONS:
* GPIO selector (Adafruit HUZZAH32 dev board)
* #21 = SW180 tilt sensor | KY032 obstacle sensor | SW420 Vibration Sensor
*
* KY032 Sensor (or any other sensor or button that reports a digital signal 0 or 1)
* !pinvalue=1 no obstacle | pinvalue=0 yes obstacle
* Connect pin 1 (left) of the sensor to DATA
* Connect pin 2 (middle) of the sensor to GND
* Connect pin 3 (right) of the sensor to VCC
I (437) example: Opening file
I (457) example: File written
I (467) example: Renaming file
I (467) example: Reading file
I (467) example: Read from file: 'Hello SU04G!'
This line will be written into the log file, not to UART