Skip to content

Instantly share code, notes, and snippets.

Matias Crivolotti maticrivo

Block or report user

Report or block maticrivo

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
@maticrivo
maticrivo / epub.css
Created Jan 10, 2018 — forked from bmaupin/epub.css
You Don't Know JS Ebooks
View epub.css
body {
text-align: justify;
}
code, pre {
font-family: "Hack", monospace;
}
h1, h2, h3, h4, h5, h6 {
text-align: left;
View trace.log
$ git push dokku master -f
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
@maticrivo
maticrivo / gist:4624e907e8405f371f89
Created Sep 16, 2015
Sickrage auto-start on osmc
View gist:4624e907e8405f371f89
git clone https://github.com/echel0n/SickRage.git sickrage
cd sickrage/
sudo cp runscripts/init.systemd /etc/systemd/system/sickrage.service
sudo chmod -x /etc/systemd/system/sickrage.service
sudo vim /etc/systemd/system/sickrage.service
sudo systemctl enable sickrage.service
sudo systemctl start sickrage.service
@maticrivo
maticrivo / EXAMPLE.conf
Created Aug 20, 2015
example for simple /etc/init/ service in ubuntu
View EXAMPLE.conf
description "EXAMPLE"
author "Matias Crivlotti <matioav@gmail.com>"
start on runlevel [2345]
stop on runlevel [!2345]
script
exec <command to execute>
end script
View test_boarding.py
import os
import time
import sys
import unittest
from appium import webdriver
class TestCase(unittest.TestCase):
View qpdf.sh
brew install qpdf
# first decrypt
qpdf --decrypt --password=mypass <FILE_NAME> dec-<FILE_NAME>.pdf
# merge
qpdf --empty --pages dec*.pdf -- all.pdf
View settings.json
{
"alt-speed-down": 999999999,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 2,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
@maticrivo
maticrivo / readingIndicator.js
Last active Sep 12, 2017
Creates a reading indicator
View readingIndicator.js
(function(){
var Indicator = function(){
var self = this, bar, latestKnownScrollY, ticking;
this.init = function init() {
latestKnownScrollY = window.scrollY;
ticking = false;
self.createIndicator();
View CSS units parser
//Open the file directly in the browser and run this script from the console
//Assumptions: The browser uses a <pre/> tag for showing the CSS code
var file = document.querySelector("pre");
var fileContent = file.innerHTML;
var newContent = fileContent.replace(/([\d.]+)(px)/g, function(m){
var measure = parseFloat(m.split("px")[0]);
var newMeasure = measure / 10;
newMeasure = newMeasure.toFixed(2);
newMeasure = newMeasure.replace(/(\.[0-9]*?)0+$/, "$1"); // remove trailing zeros
You can’t perform that action at this time.