Skip to content

Instantly share code, notes, and snippets.

View michaelbaudino's full-sized avatar

Michael Baudino michaelbaudino

View GitHub Profile
@michaelbaudino
michaelbaudino / advancedsettings.xml
Created June 11, 2018 13:32
Kodi full disk caching configuration for potentially slow, remotely mounted filesystems
<!--
This configuration will tell Kodi to cache:
* without size limit
* 40 times more data than the minimum required
* on disk (rather than in RAM)
* even for local filesystems (so NFS, any FUSE-based filesystems are covered)
Copy this file in ~/.kodi/userdata/advancedsettings.xml (or merge it with the existing one)
-->
@michaelbaudino
michaelbaudino / improve-harvest-new-invoice.js
Last active August 30, 2021 08:57
Harvest improvements
function numberFormat(number, decimals, decPoint, thousandsSep) { // Shamelessly copied from http://locutus.io/php/number_format/
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0 : +number;
var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
var sep = (typeof thousandsSep === 'undefined') ? ',' : thousandsSep;
var dec = (typeof decPoint === 'undefined') ? '.' : decPoint;
var s = '';
function toFixedFix(n, prec) {
var k = Math.pow(10, prec);
@michaelbaudino
michaelbaudino / decode_session_cookie.rb
Last active February 15, 2018 11:03 — forked from pdfrod/decode_session_cookie.rb
A simple script to decode Rails 4 session cookies
@michaelbaudino
michaelbaudino / start-docker-sync-and-wait.sh
Last active December 11, 2018 20:16
Docker Sync start script (only returns once initial sync is complete for all endpoints)
#!/bin/bash
DOCKER_SYNC_LOGFILE="/tmp/docker-sync.log"
DOCKER_SYNC_SCREEN_NAME="docker-sync"
function start_docker_sync_screen_session {
# We start `docker-sync start` twice because it often updates some images on first run and when it does,
# it exits successfully but asking for a `docker-sync clean` and then another `docker-sync start` run ¯\_(ツ)_/¯
local cmd="docker-sync clean && docker-sync start && docker-sync clean && docker-sync start"
screen -d -m -S ${DOCKER_SYNC_SCREEN_NAME} script -F ${DOCKER_SYNC_LOGFILE} bash -c "${cmd}"
@michaelbaudino
michaelbaudino / keybase.md
Created September 23, 2014 07:23
Keybase.io

Keybase proof

I hereby claim:

  • I am michaelbaudino on github.
  • I am michaelbaudino (https://keybase.io/michaelbaudino) on keybase.
  • I have a public key whose fingerprint is 8AD2 5BE0 7CC5 861E E6DF 222C B447 ACD3 845B D9F5

To claim this, I am signing this object:

@michaelbaudino
michaelbaudino / rails_version_comparison.rb
Last active August 29, 2015 13:56
Rails version matching
def rails_version_matches?(requirement)
Gem::Requirement.new(requirement).satisfied_by? Gem::Version.new(::Rails::VERSION::STRING)
end
def rails_version_matches_any?(*requirements)
requirements.map{ |r| rails_version_matches?(r) }.reduce(:|)
end
def rails_version_matches_all?(*requirements)
requirements.map{ |r| rails_version_matches?(r) }.reduce(:&)
@michaelbaudino
michaelbaudino / Bones (WP theme) in Sass syntax
Last active December 19, 2015 11:49
Bones Wordpress theme Scss files converted to Sass. If, like us, you want to use Bones (http://themble.com/bones) but prefer Sass syntax over Scss one, feel free to use these translated files.
This file is just to have a nicely named Gist. Do not care about it.
@michaelbaudino
michaelbaudino / programme-lyonrb-2013-2014.md
Last active December 19, 2015 09:49
Programme proposé pour Lyon.rb pour l'exercice 2013-2014

Programme pour Lyon.rb (WIP)

Intro

Ce document présente ce que propose la liste composée de Camille Appert et Michael Baudino pour Lyon.rb pour l'année 2013-2014.

Meetups

Communication

@michaelbaudino
michaelbaudino / validates_timeliness.fr.yml
Last active December 18, 2015 05:59
French locale file for validates_timeliness gem (https://github.com/adzap/validates_timeliness)
fr:
errors:
messages:
invalid_date: "n'est pas un objet Date valide"
invalid_time: "n'est pas un objet Time valide"
invalid_datetime: "n'est pas un objet DateTime valide"
is_at: "doit être %{restriction}"
before: "doit être avant %{restriction}"
on_or_before: "doit être le ou avant le %{restriction}"
after: "doit être après %{restriction}"
@michaelbaudino
michaelbaudino / foundation_and_overrides.css.sass
Created May 5, 2013 09:26
Zurb Foundation 4 overrides (customization) file, converted to sass syntax (originally generated by `rails g foundation:install` in scss syntax)
////
//// Foundation Variables
////
//// The default font-size is set to 100% of the browser style sheet (usually 16px)
//// for compatibility with brower-based text zoom or user-set defaults.
$base-font-size: 100% !default
//// $base-line-height is 24px while $base-font-size is 16px
// $base-line-height: 150%