Skip to content

Instantly share code, notes, and snippets.

@MattiSG
MattiSG / index.md
Created October 14, 2014 19:57
Humble Mozilla Bundle

I'll try to elaborate a bit more on https://twitter.com/matti_sg/status/522103990373588992 and explain why the Humble Mozilla Bundle is such a noticeable event.

Let's recap what's happening: a non-profit (Mozilla) partners with an indie promotion platform (HumbleBundle) to promote its free open-source tech (asm.js and Firefox). It uses all its communication power for this (social accounts but, more importantly, the Firefox start page that morphs into a game itself). Private, independent actors (the game creators and HumbleBundle) benefit from this, the non-profit does too (portions of the bundle price go back to Mozilla), and most of all the union of such big actors proves the platform can deliver the promise.

Mozilla had done several demos of HTML5 + WebGL + asm.js being a proper platform for

@MattiSG
MattiSG / Count unread mails.js
Created November 21, 2014 09:52
Userscripts for Outlook webmail
/** If you use Fluid.app, this is a drop-in.
* The variable storing the count of unread mails is window.fluid.dockBadge, change it as needed for your use case.
*/
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
@MattiSG
MattiSG / gist:91cc73e0f8cf76ddf094
Created January 9, 2015 14:22
OpenFisca failure stack trace
14:57:59,557 ERROR [openfisca_core.formulas] An error occurred while calling formula individus@reintegration_titre_restaurant_employeur<2015-02> in openfisca_france.model.cotisations_sociales.remuneration_prive.reintegration_titre_restaurant_employeur
14:57:59,558 ERROR [openfisca_core.formulas] An error occurred while calling formula individus@salbrut<2015-02> in openfisca_france.model.cotisations_sociales.remuneration_prive.salbrut
14:57:59,558 ERROR [openfisca_core.formulas] An error occurred while calling formula individus@ratio_smic_salaire<2015> in openfisca_france.model.cotisations_sociales.allegements.function_2012
14:57:59,558 ERROR [openfisca_core.formulas] An error occurred while calling formula individus@allegement_fillon_annuel<2015> in openfisca_france.model.cotisations_sociales.allegements.allegement_fillon_annuel
14:57:59,558 ERROR [openfisca_core.formulas] An error occurred while calling formula individus@allegement_fillon<2015-01> in openfisca_france.model.cotisations_sociales.allegements.al
@MattiSG
MattiSG / keybase.md
Created April 18, 2015 15:28
keybase.md

Keybase proof

I hereby claim:

  • I am mattisg on github.
  • I am mattisg (https://keybase.io/mattisg) on keybase.
  • I have a public key whose fingerprint is 4153 9680 D622 BF41 8CFE 53AD D175 0153 BF1B E9D0

To claim this, I am signing this object:

@MattiSG
MattiSG / 1 - ValidatedScenario.js
Last active November 3, 2015 08:59
Selenium issue reproduction case
description: 'Invalid fields should be clearable',
steps: [
InputComponent.setValidatedField('2'),
{ 'InputComponent.validatedField': '2' },
InputComponent.setValidatedField('e'),
{ 'InputComponent.validatedField': 'e' },
InputComponent.setValidatedField('3'),
{ 'InputComponent.validatedField': '3' }, // fails: `e` was invalid, the field is not cleared and contains `e3`
]
@MattiSG
MattiSG / upgrade-watai-06-07.js
Last active November 7, 2015 17:40
Upgrade Watai test suites from v0.6 to v0.7
#!/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
MattiSG / README.md
Last active February 5, 2016 15:47
ChromeDriver issue reproduction

With a running ChromeDriver:

git clone https://gist.github.com/4805526b5dcea0897c27.git
npm install selenium-webdriver
node index.js
@MattiSG
MattiSG / README.md
Last active July 28, 2022 06:49
Convert a wiki from MediaWiki to Gollum and Markdown, importing all metadata.

This will convert a wiki from MediaWiki to Gollum and Markdown (or any other format supported by Pandoc).

  1. Install dependencies:

    brew install pandoc icu4c
    gem install --no-ri --no-rdoc hpricot gollum gollum-lib pandoc-ruby
  2. Perform a Special:Export

@MattiSG
MattiSG / README.md
Last active November 3, 2016 16:07
How to get thumbnails on webpages

How to get thumbnails on pages

@MattiSG
MattiSG / README.md
Last active January 4, 2023 02:33
Deploy bot

Continuous deployment with Git and SSH

This article presents how to deploy continuously from a Git repository with high security, by creating a UNIX user whose only purpose and ability is to update a repository and execute commands from a script within the repository upon successful SSH connections.

Prerequisites

Your server has at least Git and some SSH agent installed, and you are connected to it as root.

Just to rephrase: all these commands are to be executed on your server, as root. ssh root@YOUR_SERVER now!