Skip to content

Instantly share code, notes, and snippets.

Alexis Metaireau almet

Block or report user

Report or block almet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Gestion de stock.md

Gestion de stock brasserie

A la brasserie, on gère pas mal de demande en fûts. Une commande ressemble à:

  • date
  • nombre de fûts pour chaque bière
  • mise à disposition de tireuse ? oui/non

Par exemple:

@almet
almet / instructions.md
Created Oct 23, 2017
Ardour setup on linux
View instructions.md

Ardour setup on linux

  1. Install ardour
  2. adduser alexis audio
  3. log-out and log-in again (no need to reboot)
  4. Dans une console, lancer la detection du micro avec la commande alsa_in -dhw:H2n

Il est possible d'éviter cette étape manuelle en faisant comme suit:

Vous pouvez utiliser la fonctionnalité de lancement de script de QjackCtl : dans qjackctl -> réglage -> options -> activer "Exécuter un script au démarrage" et y mettre votre ligne. Il ne vous reste qu'à redémarrer qJackCtl, et le tour est joué.

View kinto2csv.py
# -*- coding: utf-8 -*-
import unicodecsv as csv
import sys
import json
def json_to_csv(source, destination):
loaded_json = json.load(source)['data']
writer = csv.writer(destination)
# First row contains the titles
View foo.diff
diff --git a/formbuilder/components/AdminView.js b/formbuilder/components/AdminView.js
index 8de0b88..c81795e 100644
--- a/formbuilder/components/AdminView.js
+++ b/formbuilder/components/AdminView.js
@@ -25,19 +25,19 @@ export default class AdminView extends Component {
content = (
<div>
<h3>Results for {title}</h3>
- <DropdownButton title="Download as..." id="bg-nested-dropdown" className="pull-right">
- <MenuItem>
View changes.diff
diff --git a/formbuilder/components/AdminView.js b/formbuilder/components/AdminView.js
index 249fc74..9a8739c 100644
--- a/formbuilder/components/AdminView.js
+++ b/formbuilder/components/AdminView.js
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import CSVDownloader from "./CSVDownloader";
import XLSDownloader from "./XLSDownloader";
-import DownloadFormatDropdown from "./DownloadFormatDropdown";
import URLDisplay from "./URLDisplay";
@almet
almet / ihatemoney-stats.py
Last active Jan 13, 2019
ihatemoney stats
View ihatemoney-stats.py
# IHATEMONEY_SETTINGS_FILE_PATH=/home/ihatemoney/ihatemoney.org/ihatemoney.cfg ./ihatemoney.org/venv/bin/ihatemoney shell
>>> # To know the number of projects with more than 10 bills and less than 3 months old.
>>> from ihatemoney.models import *; import datetime
>>> projects = [pr for pr in Project.query.all() if pr.get_bills().count() > 10 and pr.get_bills()[0].date > datetime.date.today() - datetime.timedelta(days=90)]
>>> len(projects)
>>> # To get the email of the contacts
>>> ", ".join(set([pr.contact_email for pr in projects]))
View pelicanconf.py
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHORS = (
u'Brasserie du Vieux Singe',
)
SITENAME = u'Vieux Singe'
SITEURL = 'http://localhost:8000'
View about.html
<!DOCTYPE HTML>
<html>
<head>
<title>La Brasserie du Vieux Singe</title>
<meta charset="utf-8" />
<meta name="slug" content="a-propos" />
<meta name="save_as" content="index.html" />
<meta name="og_url" content="http://www.vieuxsinge.com/" />
<meta name="og_type" content="website" />
@almet
almet / named.py
Last active Jun 18, 2016
Use named pipes to stream answers between processes without buffering (thanks to stdbuf -o0)
View named.py
import os
import shlex
import subprocess
def spawn(cmd):
os.mkfifo("toto")
with open("toto", "w") as f:
process = subprocess.Popen(shlex.split(cmd), stdout=f)
process.wait()
View -
/*eslint no-unused-vars: [2, { "varsIgnorePattern": "^d$" }]*/
import { expect } from "chai";
import sinon from "sinon";
import config from "../../formbuilder/config";
import { createComponent, d } from "../test-utils";
import FieldList from "../../formbuilder/components/builder/FieldList";
You can’t perform that action at this time.