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.
@simonjodet
simonjodet / app.php
Created October 21, 2012 16:35
Silex automatic post-registration user authentication
<?php
$app['security.firewalls'] = array(
'user_firewall' => array(
'pattern' => new \Application\UserRequestMatcher($app['request']),
'form' => array('login_path' => '/login', 'check_path' => '/authenticate'),
'logout' => array('logout_path' => '/logout'),
'users' => $app->share(function () use ($app)
{
return new \Application\UserProvider($app);
}),
@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 / .bashrc
Created January 2, 2012 13:52
My Mac .bashrc file
#Colors
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
#General aliases
alias la='ls -la'
#Git branch indicator for bash prompt
parse_git_branch ()
{
@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"
@simonjodet
simonjodet / test.sh
Created December 13, 2012 14:15
Test for Gumdrop installer
# PHP 5.3+ (CLI) required. Should work with stock PHP on Mac OS 10.8.
cd /tmp
php -r "$(curl -s https://raw.github.com/simonjodet/gumdrop/develop/installer.php|tail -n +2)"