Skip to content

Instantly share code, notes, and snippets.

Avatar

jhuesser jhuesser

View GitHub Profile
@jhuesser
jhuesser / siriwrapper.php
Created Sep 18, 2018
A quick and dirty json parser for opentransportdata.ch to use it with siri shortcuts
View siriwrapper.php
<?php
$departure = "8573710"; // ID of departure
$destination = "8503504"; // ID of destination
// use param transportations[] to filter transport type (train, tram, bus, etc.
$url = "http://transport.opendata.ch/v1/connections?from=". $departure . " . &to=" . $destination . "&date=" . date('Y-m-d');
$result = json_decode(file_get_contents($url));
// connections[0] seems to be to early, a quick and dirty fix
View backup.sh
#!/bin/bash
backupdir="/BACKUP/"
mkdir -p $backupdir
latestbak=${backupdir}/latest/
function getDir {
read -p "Enter the absolute path to the directory: " path
}
View configure_sound.sh
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Please use sudo configure_sound.sh."
echo "ERROR: You are not root."
exit 1
fi
apt-get update
apt-get -y install omxplayer
@jhuesser
jhuesser / shutdown.scpt
Created Jan 22, 2016
Shutdown your mac on time
View shutdown.scpt
--Shutdown your mac
--by Jonas Hüsser
--https://www.hüsser.ch/jonas/mac-zeitgesteuert-ausschalten/
set timeQuery to 1
--This value is used to stop the repeat
repeat until timeQuery is 0 --start repeat
set HH to ((get time of (current date)) / 3600)
set HH to round HH rounding down
set MM to (((get time of (current date)) - HH * 3600) / 60)
set MM to round MM rounding down
@jhuesser
jhuesser / index.html
Last active Jan 22, 2016
Header YT link
View index.html
<html>
<head>
<meta name="google-site-verification" content="xjhflajsjfdlkjwqoejroiflkhsdkfjöowkljendas" />
<title>Titel</title>
</head>
<body>
<!--Seiteninhalt -->
</body>
</html>
View imageScaler.scpt
-- Script by Apple Inc.
-- Modified by Jonas Huesser
-- 8th dec 2014
-- http://jonas.xn--hsser-kva.ch
set boo to 0 -- boolean value
set n to 0 -- counter value
repeat until boo is 1
display dialog "How many files do you want to scale?" default answer "1" buttons {"Cancel", "Next"} default button 2 with title "Enter an integer" with icon note -- ask how many files to scale
You can’t perform that action at this time.