Skip to content

Instantly share code, notes, and snippets.

View fmarcia's full-sized avatar

Franck Marcia fmarcia

  • Cesson-Sévigné, France
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Tetris</title>
</head>
<body>
<script src="tetris.js"></script>
@fmarcia
fmarcia / git-sync.sh
Last active September 24, 2020 08:59
Automatic push-to-production
#!/bin/bash
# P R E P A R E E N V I R O N M E N T
# prepare playground
playground=/tmp/playground
mkdir -p $playground
cd $playground
html, body {
margin: 0;
height: 100%;
}
svg#clock {
display: block;
margin: 0 auto;
background-color: #000;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Check</title>
</head>
<body>
pickmeup.defaults.locales['fr'] = {
days: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
daysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
daysMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
monthsShort: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc']
};
pickmeup('.range', {
flat: true,
const f = (id, fail) =>
new Promise((y, n) =>
setTimeout(_ => {
console.log(id)
fail ? n() : y()
}, 100)
)
const a = _ =>
new Promise(y =>
@fmarcia
fmarcia / better.js
Last active February 15, 2018 18:59
Remove items
var limit = 4;
arr = arr.filter(e => {
if (e.a < limit) {
delete obj[e.n];
} else {
return true;
}
});
html {
height: 100%;
}
body {
font-family: arial;
font-size: 12px;
height: 100%;
margin: 0;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>SVG</title>
<style>
body { margin: 0; }
#content { left: 300px; overflow: hidden; position: absolute; right: 30px; top: 30px; }
svg { position: absolute; right: 0; top: 0; }
rect { height: 20px; stroke-width: 1px; stroke: #fff; }
#!env node
const fs = require("fs");
const sax = require("./sax");
function parseXml(filename) {
const parser = sax.parser(true);
const doc = {};