Skip to content

Instantly share code, notes, and snippets.

@MattiSG
MattiSG / Artifacts, practice and knowledge elaboration.md
Created May 29, 2014 18:13
“Artefacts, practice & knowledge elaboration” seminary notes

Artefacts, practice & knowledge elaboration: an interdisciplinary perspective

Introduction

Two views of artefacts:

  • [Artefacts in groups?]
  • Artefacts as the prolongation of cognitive systems.
@MattiSG
MattiSG / localize_helper.rb
Created October 14, 2013 12:02
Add number localization to Rails' `i18n` module.
module LocalizeHelper
# Wraps I18n.localize to add support for Numbers l12n.
#
# @param value [Numeric|DateTime|Time|Date] The value to localize.
# @return [String] The localized value.
# @see <https://github.com/svenfuchs/i18n/issues/135>
def localize(value)
if value.is_a?(Numeric)
number_with_delimiter(value, locale: I18n.locale)
<html>
<head>
<title>Async demo</title>
<style>
body {
width: 100%;
min-height: 8em;
border: 1px solid red;
}
</style>
@MattiSG
MattiSG / map.geojson
Last active November 3, 2016 15:08
All Internet Exchange Points listed on Wikipedia, mapped. Used in the State Surveillance map: http://mattischneider.fr/h4yr/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MattiSG
MattiSG / upgrade-watai-05-06.sh
Last active December 22, 2015 10:59
Upgrade Watai from 0.5 to 0.6 syntax
#!/bin/bash
# Partially upgrades Watai tests from v0.5 syntax to v0.6
# Removes enclosing curly braces from Feature and Widget files
IFS=$(echo -en "\n\b")
for file in $(find -E "$1" -regex ".*(Feature|Widget)\.js$" -type f)
do
mv "$file" "$file~"
grep -v '^[{}]$' "$file~" | sed 's:^ ::g' > "$file"
@MattiSG
MattiSG / popAndBounce.css
Created February 13, 2013 14:13
[animate.css](http://daneden.me/animate/) extension: `popAndBounce`. This one is intended to be repeated.
@-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);
@MattiSG
MattiSG / Résumé Dani.md
Last active December 11, 2015 05:18
Résumé du “Projet d’accord national interprofessionnel sur la sécurisation de l’emploi” tel que validé en janvier 2013.

Accords Dani

Source

  • 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
MattiSG / wrap.js
Created January 15, 2013 16:03
Wraps a substring of a string with the given prefix and suffix, ignoring case for finding while still respecting it in the resulting string.
/** 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
MattiSG / set-arity.js
Created November 7, 2012 15:06
Set the arity of a function in JavaScript
/** 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.
*@private
*/
function declareArguments(count) {
return new Array(count).join('arg,') + 'arg';
}