Skip to content

Instantly share code, notes, and snippets.

View AntoineTurmel's full-sized avatar

Antoine Turmel AntoineTurmel

View GitHub Profile
@AntoineTurmel
AntoineTurmel / getInfos.php
Created May 15, 2020 10:09
Display PHP version with ?info=phpVersion or Raspberry Pi Revision Model with ?info=device (it needs pi-model.json from https://github.com/gablau/rpi-revision-codes-utility/blob/master/pi-model.json )
<?php
function getRaspberryPiVersion($revision) {
$fp = fopen('pi-model.json', 'r');
$filename = "pi-model.json";
$contents = fread($fp, filesize($filename));
fclose($fp);
$json = json_decode($contents);
foreach ($json as $item) {
if ($item->Code == $revision) {
@AntoineTurmel
AntoineTurmel / musikG15.js
Created December 26, 2017 03:09
rough script to display artist/title and use media keys on musikCube/Linux
const WebSocket = require('ws');
var EventEmitter = require('events').EventEmitter;
const ws = new WebSocket('ws://127.0.0.1:7905');
var g15composer = require('g15composer').init('/home/antoine/dev/musikG15/pipe', 'notifications');
ws.on('open', function open() {
ws.send('{ "name": "authenticate", "type": "request", "id": "foobar", "options": { "password": "" }}');
/* =============================================================
* bootstrap-typeahead.js v2.3.2
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@AntoineTurmel
AntoineTurmel / idea.json
Created June 12, 2015 14:34
example of idea in json
{
"name": "My idea",
"author": "Me",
"submitdate": "2015-01-01",
"lastupdate": "2015-02-31",
"version": "0.1",
"shortdescription": "My idea is to change the world",
"longdescription": "Lorem Ideapsum",
"urls": {
"idea": "http://linktomyidea.com",
// ==UserScript==
// @name Flickr RSS Feed
// @name:fr Flux RSS Flickr
// @namespace https://greasyfork.org/fr/users/11510-antoine-code
// @author Antoine Turmel
// @version 1.0.2
// @description Adds back RSS feeds to Flickr galleries
// @description:fr Réajoute le flux RSS des galeries Flickr
// @icon https://cloud.githubusercontent.com/assets/119288/7681140/9284a93e-fd6d-11e4-8854-89ab643b600a.png
// @icon64 https://cloud.githubusercontent.com/assets/119288/7681134/811317e4-fd6d-11e4-8350-2dac0d5f0d66.png
@AntoineTurmel
AntoineTurmel / locales.xml
Created January 5, 2014 03:09
Nightingale locales.xml example for distributing langpacks
<?xml version="1.0" encoding="UTF-8"?>
<SongbirdInstallBundle version="2">
<XPI name="Afrikaans" id="[email protected]" languageTag="af" url="http://locales.getnightingale.com/langpacks/1.12.1/langpack-af-1.12.1.xpi"/>
<XPI name="عربي" id="[email protected]" languageTag="ar" url="http://locales.getnightingale.com/langpacks/1.12.1/langpack-ar-1.12.1.xpi"/>
<XPI name="Български" id="[email protected]" languageTag="bg" url="http://locales.getnightingale.com/langpacks/1.12.1/langpack-bg-1.12.1.xpi"/>
<XPI name="বাংলা (ভারত)" id="[email protected]" languageTag="bn-IN" url="http://locales.getnightingale.com/langpacks/1.12.1/langpack-bn-IN-1.12.1.xpi"/>
<XPI name="Català" id="[email protected]" languageTag="ca" url="http://locales.getnightingale.com/langpacks/1.12.1/langpack-ca-1.12.1.xpi"/>
<XPI name="Čeština" id="[email protected]" languageTag="cs" url="http://locales.getnightingale.com/langpacks/1.12.1/langpack-cs-1.12.1.
@AntoineTurmel
AntoineTurmel / search.js
Created July 1, 2012 00:31
Entity Tool
/**
* Saebekassebil <Jakob Miland> 2012
* GeekShadow <Antoine Turmel> 2012
*
* Put this file in top of the project directory
* $ node search.js
*
**/
var fs = require('fs'),