Skip to content

Instantly share code, notes, and snippets.

View meyerbaptiste's full-sized avatar
🇨🇭
Yodelling

Baptiste Meyer meyerbaptiste

🇨🇭
Yodelling
View GitHub Profile
<?php
use Symfony\Component\HttpFoundation\Request;
/**
* @see https://github.com/symfony/symfony/pull/18834
*/
class FieldsHelper
{
private function __construct()
{

Keybase proof

I hereby claim:

  • I am meyerbaptiste on github.
  • I am meyer_baptiste (https://keybase.io/meyer_baptiste) on keybase.
  • I have a public key ASCQG7eWtiE4ORyqnrhWV-4tJldUG8Uyacsy0Z3YPvtNBgo

To claim this, I am signing this object:

#!/usr/bin/env bash
# Notes:
# - tsort requires as input a stream of pairs (a, b) where package a depends
# on package b. If package a has k > 1 dependencies, we should have k lines
# associated to it; if package a has no dependencies, then we should have a
# single line (a, a). The pairs are just space delimited, no parentheses.
# the little awk program below formats the data that way for tsort.
# - tsort outputs the order from bottom to top; that's why we need to reverse
# it with tail -r.
@meyerbaptiste
meyerbaptiste / get-date-with-offset.js
Last active August 29, 2015 14:06
Get a date with an offset in JS
'use strict';
var getDateWithOffset = function getDateWithOffset(date, offset) {
if (!(date instanceof Date)) {
throw new TypeError('The parameter "date" must be a Date object.');
}
if (typeof offset !== 'number') {
throw new TypeError('The parameter "offset" must be a number.');
}
@meyerbaptiste
meyerbaptiste / gnome-inhibitor-vlc.py
Last active August 29, 2015 14:05
Gnome 3 inhibitor for VLC (Python)
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import dbus
class inhibitor:
def __init__(self):
bus = dbus.SessionBus()
@meyerbaptiste
meyerbaptiste / gnome-inhibitor-vlc.sh
Last active August 29, 2015 14:05
Gnome 3 inhibitor for VLC (Bash)
#!/bin/bash
IDLE_ACTIVATION_ENABLED=$(gsettings get org.gnome.desktop.screensaver idle-activation-enabled)
SLEEP_INACTIVE_AC=$(gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac)
SLEEP_INACTIVE_BATTERY=$(gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery)
start_inhibitor () {
if [ $IDLE_ACTIVATION_ENABLED == true ]; then
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
fi