This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void serialEvent() { | |
//serialEvent est appelée à la fin de la boucle si des données sont dispos sur le RX | |
while(Serial.available()) { | |
incoming_byte = (byte) Serial.read(); | |
if(highByte(incoming_byte)) { | |
// Header | |
serial_i = incoming_byte & B00011111; // serial_i = compteur | |
// Note: serial_i = 0 => à traiter | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local wibox = require("wibox") | |
local awful = require("awful") | |
brightness_widget = wibox.widget.textbox() | |
brightness_widget:set_align("right") | |
function round(num, idp) | |
return tonumber(string.format("%." .. (idp or 0) .. "f", num)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "NO2", | |
"coordinates": [30, 10], | |
"spatial_validity": 10, | |
"measure": 150, | |
"timestamp": TIMESTAMP, | |
"time_validity": 3600, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parsed2Bibtex(parsed): | |
""" | |
Convert a single bibtex entry dict to bibtex string | |
""" | |
data = parsed.get_entry_dict() | |
bibtex = '' | |
for entry in data.keys(): | |
bibtex += '@'+data[entry]['type']+'{'+data[entry]['id']+",\n" | |
for field in [i for i in sorted(data[entry]) if i not in ['type', 'id']]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_toute_prete(y): | |
return y | |
def operation(n): | |
""" | |
operation(n) is a function that adds n to its argument if n = 0 [2] or multiply n by its two arguments if n = 1 [2]. | |
For instance, add(3) : x -> x * 3 | |
""" | |
functions = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf8 -*- | |
# ----------------------------------------------------------------------------- | |
# "THE NO-ALCOHOL BEER-WARE LICENSE" (Revision 42): | |
# Phyks ([email protected]) wrote or updated these files for hackEns. As long | |
# as you retain this notice you can do whatever you want with this stuff | |
# (and you can also do whatever you want with this stuff without retaining it, | |
# but that's not cool...). | |
# | |
# If we meet some day, and you think this stuff is worth it, you can buy us a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def notifs_emprunts(self, serv): | |
"""Notifications when borrowing is over""" | |
now = datetime.datetime.now() | |
1h_later = now + datetime.timedelta(hours=1) | |
query = ("SELECT borrower, tool, until FROM borrowings " + | |
"WHERE until BETWEEN %s AND %s") | |
try: | |
self.bdd_cursor.execute(query, (now, 1h_later)) | |
except mysql.connector.errors.Error: | |
serv.say(serv, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//$thumbdir = str_replace('/..', '', $thumbdir); // Prevent directory traversal attacks. | |
if(strstr($thumbdir, '..') !== FALSE) { | |
$requestedDir = ''; | |
$thumbdir = rtrim('photos/','/'); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: diaspora | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts diaspora | |
# Description: starts diaspora using start-stop-daemon | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Open questions | |
* Right endpoint to tag an entry ? a feed ? (in /feed, resp /entry, or in /tag) | |
* Right endpoint to share an entry ? (in /entry or in /share) | |
## Feeds endpoint | |
* GET /feeds | |
* Get a list of all the available feeds. |
OlderNewer