Skip to content

Instantly share code, notes, and snippets.

View simonjodet's full-sized avatar

Simon Jodet simonjodet

View GitHub Profile
blueprint:
name: Thermostat TPI
description: Thermostat TPI (Time Propertional & Integral)
domain: automation
input:
coeff_c:
name: Coefficient C
description: coefficient multiplicateur de la différence entre la consigne et la température intérieure pour le calcul de la puissance (0.6 conseillé)
selector:

Keybase proof

I hereby claim:

  • I am simonjodet on github.
  • I am neuromancer99 (https://keybase.io/neuromancer99) on keybase.
  • I have a public key ASC6ffhtTtuMPlVmCjlRYHxKxLshVQDXJ5fHZDL_mtkKuwo

To claim this, I am signing this object:

@simonjodet
simonjodet / HOWTO.md
Last active December 11, 2018 00:09
Quick audio interface switch for Mac OS
  1. Create a /usr/local/bin/audiointerfaceswitch.sh file with the content above. Change "FiiO USB DAC-E10" with the name of your interface. Run /usr/local/bin/SwitchAudioSource -a to get a list of the available interfaces on your system.
  2. With Automator.app, create an app
  3. Run the app to switch interfaces. Use a launcher or BetterTouchTool or a similar tool to map the app to a keyboard shortcut.
<!DOCTYPE HTML>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>Dynamic Pagination w/ Filtering</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Kim Maida">
<!-- JS Libraries -->
@simonjodet
simonjodet / ngselectonfocus.js
Created June 10, 2014 15:04
Angular directive to select the content of a textarea when it's focused
'use strict';
angular.module('myApp').directive(
'ngSelectOnFocus',
function() {
var factory = {
restrict: 'A',
link: function postLink(scope, element) {
$(element).focus(function(event) {
event.target.select();
@simonjodet
simonjodet / ngtoggle.js
Last active August 29, 2015 14:02
Angular directive to have an element toggle another element's display on click
'use strict';
angular.module('myApp').directive(
'ngToggle',
function() {
var factory = {
restrict: 'A',
link: function postLink(scope, element, attributes) {
$(element).on('click', function(event) {
event.preventDefault();
@simonjodet
simonjodet / add_to_iTunes.scpt
Created June 1, 2013 18:57
This is how you add a video to iTunes as a TV Show with AppleScript. Save it as "add_to_iTunes.scpt" using /Applications/Utilities/AppleScript Editor Run it with "osascript add_to_iTunes.scpt /absolute/path/to/video/file.mp4"
on run {input}
tell application "iTunes"
set newFile to input as POSIX file
set newAddition to (add newFile)
tell newAddition to set video kind to TV show
end tell
end run
@simonjodet
simonjodet / vagrant_setup.sh
Last active December 12, 2015 09:49
Ubuntu minimal setup for a Vagrant base box
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@simonjodet
simonjodet / iPhoto_launcher.sh
Last active December 11, 2015 18:48
This code mounts the USB Hard Drive where the iPhoto library is stored, launch iPhoto then unmount the drive when iPhoto is closed.
VOL='/dev/'$(diskutil list | grep -Eo '.*Apple_HFS Pictures.*' | grep -Eo 'disk.s.')
hdiutil mountvol $VOL
open -W /Applications/iPhoto.app
hdiutil detach $VOL
@simonjodet
simonjodet / create_new_file.txt
Created December 18, 2012 07:48
Edit a file on Github through the API
curl --user "simonjodet" -i --data '{"content": "new test","encoding": "utf-8"}' https://api.github.com/repos/simonjodet/sandbox/git/blobs
HTTP/1.1 201 Created
Server: nginx
Date: Tue, 18 Dec 2012 08:13:45 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 201 Created
Location: https://api.github.com/repos/simonjodet/sandbox/git/blobs/6e6ab611ec78d425b37fcb26c3d817d71e58afcb
ETag: "4774fa91e9a71a16564b43460b72d649"