Skip to content

Instantly share code, notes, and snippets.


Matti Schneider MattiSG

View GitHub Profile
MattiSG / gist:3471254
Created Aug 25, 2012
Make links from URL list
View gist:3471254
# Outputs an HTML <a> list from a list of URLs, fetching destination page titles on the go
# param = input file, in which URLs are stored, one per line
for url in $(cat $1)
echo '<a href="'$url'">'
curl "$url" 2> /dev/null | grep '<title>' -A 1 | tail -1 | tr -s ' '
echo '</a>'
MattiSG /
Created Oct 5, 2012
Deprecate old git tags by prefixing them, but keeping their message if one is given.
for tag in $(git tag) # cleanup in case of half-done transition
if echo $tag | grep "$OLD_NAME"
then git tag -d $tag
for tag in $(git tag)
MattiSG /
Created Oct 10, 2012
Dirty shell to compare installed gems versions with the ones expected from a Gemfile
# Compares installed gems versions with the expected ones from a Gemfile.
# Ignores non-strict-equal dependencies (i.e. ~> 1.5 will output the same as = 1.5).
DEST_DIR="$HOME/Desktop/gems-comparison" # no trailing slash
MattiSG /
Created Oct 13, 2012
Automatically add GrowlMail plugin compatibility to the latest version
# Updates the Growl Mail plugin when unknown compatibility preemptive deactivation happens.
# This consists in finding the “compatibility UUID” for the new Mail version, and adding it to the supported UUIDs of GrowlMail.
# See for more details on the procedure.
# Author: Matti Schneider <>
# Either ~/Library or /Library depending on the type of install (local or global).
INSTALL_ROOT="/Users/`whoami`/Library/Mail/" # the default is to assume a local install
MattiSG / set-arity.js
Created Nov 7, 2012
Set the arity of a function in JavaScript
View set-arity.js
/** Returns a string that looks like a function arguments list definition.
*@param {Number} count How many arguments should be generated.
*@returns {String} An arguments declaration list usable in a Function constructor.
function declareArguments(count) {
return new Array(count).join('arg,') + 'arg';
MattiSG / 1 - ValidatedScenario.js
Last active Nov 3, 2015
Selenium issue reproduction case
View 1 - ValidatedScenario.js
description: 'Invalid fields should be clearable',
steps: [
{ 'InputComponent.validatedField': '2' },
{ 'InputComponent.validatedField': 'e' },
{ 'InputComponent.validatedField': '3' }, // fails: `e` was invalid, the field is not cleared and contains `e3`
MattiSG / upgrade-watai-06-07.js
Last active Nov 7, 2015
Upgrade Watai test suites from v0.6 to v0.7
View upgrade-watai-06-07.js
#!/usr/bin/env node
// Partially upgrades a Watai test suite from v0.6 to v0.7 syntax.
// Usage: node upgrade-watai-06-07.js path/to/test/suite/folder [another/test/suite [another/suite …]]
// Only renames files.
var fs = require('fs');
process.argv.splice(0, 2);
MattiSG / wrap.js
Created Jan 15, 2013
Wraps a substring of a string with the given prefix and suffix, ignoring case for finding while still respecting it in the resulting string.
View wrap.js
/** Wraps a substring with the given prefix and suffix in a string.
*@param {String} hay The string in which the replacement is to occur.
*@param {String} needle The string to look for. Will be wrapped without case sensitivity, but will respect the case of the original string.
@param {String} prefix The string to insert before `needle`.
@param {String} suffix The string to insert after `needle`.
function wrap(hay, needle, prefix, suffix) {
var lowHay = hay.toLowerCase(),
lowNeedle = needle.toLowerCase(),
MattiSG / Résumé
Last active Dec 11, 2015
Résumé du “Projet d’accord national interprofessionnel sur la sécurisation de l’emploi” tel que validé en janvier 2013.
View Résumé

Accords Dani


  • mise en œuvre au plus tard au 1er janvier 2016
  • complémentaire santé remboursant 100% de la base sécu des actions courantes, 125% du dentaire et 100€ forfaitaire / an pour l'optique, financée à 50% employeur / 50% salarié
  • report des droits au chômage d'une période d'emploi sur l'autre
  • hausse des cotisations patronales à l'assurance chômage sur les contrats courts : 7% pour < 1 mois, 5,5% pour 1 mois < 3 mois (base actuelle : 4%)
  • exonération des cotisations patronales à l'assurance chômage pendant 3 mois pour l'embauche d'un jeune < 26 ans
MattiSG / popAndBounce.css
Created Feb 13, 2013
[animate.css]( extension: `popAndBounce`. This one is intended to be repeated.
View popAndBounce.css
@-webkit-keyframes popAndBounce {
0%, 40% {
-webkit-transform: scale(1);
5% {
-webkit-transform: scale(0.9);
opacity: 0.7;
10%, 15%, 28%, 35% {
-webkit-transform: scale(1.2) translateX(0);