Skip to content

Instantly share code, notes, and snippets.

@oliveratgithub
oliveratgithub / Apple_find_city.asp.xml
Last active Sep 21, 2015
Example call to accuweather.com from Apple's Weather Dashboard Widget in OS X Yosemite, http://apple.accuweather.com/adcbin/apple/Apple_find_city.asp?location=Zurich
View Apple_find_city.asp.xml
<adc_Database xmlns="http://www.accuweather.com">
<CityList us="4" intl="3" extra_cities="0">
<location city="Zurich" state="KS" postal="lid_2137121"/>
<location city="Zurich" state="NY" postal="lid_2171451"/>
<location city="Zurich" state="MT" postal="lid_349249"/>
<location city="Zurich" state="CA" postal="lid_2143185"/>
@oliveratgithub
oliveratgithub / class.mythemenamethemehooks.php
Last active Oct 5, 2015
Vanilla Community Forum custom Theme hook to add custom apple-touch-icons and favicon to your site
View class.mythemenamethemehooks.php
<?php if (!defined('APPLICATION')) exit();
class MythemenameThemeHooks implements Gdn_IPlugin
{
/**
* No setup required
*/
public function Setup() { }
/**
@oliveratgithub
oliveratgithub / Add Reminder to Wunderlist.scpt
Last active Nov 13, 2015
AppleScript to add a Text selection as a new Reminder to Wunderlist
View Add Reminder to Wunderlist.scpt
on run {input, parameters}
-- This code comes from http://raduner.ch/blog/
-- To be used with an Automator Service
-- ------------------------------------------------
tell application "System Events"
keystroke "c" using {command down}
end tell
set inputText to the clipboard as Unicode text
@oliveratgithub
oliveratgithub / curl_url_check.sh
Last active Jun 8, 2017
Simple one-liner curl command for macOS/Unix bash terminal to repeatedly check a specific url
View curl_url_check.sh
# Remark: list of valid timezones: wikipedia.org/wiki/List_of_tz_database_time_zones
clear; while [ : ]; do curl -sSL -w '%{http_code} %{url_effective} ' "https://github.com" -o /dev/null; echo $(TZ=":Europe/Zurich" date); sleep 5; done
@oliveratgithub
oliveratgithub / ddns_updater.sh
Created Nov 5, 2015
Automatic Dynamics DNS updater using HTTP API calls, prepared for TwoDNS.de / Two-DNS.de (works with any other DDNS Service, allowing IP updates via HTTP API calls)
View ddns_updater.sh
#!/bin/sh
log="ddns_updater.log.txt"
my_ext_ip=$(curl -sS http://icanhazip.com)
echo "\n\n\n===== \
\n$(date -u) \
\nUpdating IP to: $my_ext_ip \n" >> $log
curl -isSX PUT \
-u "mail@host.tld:api_token" \
-H "Content-Type: application/json" \
--data '{"ip_address":"'$my_ext_ip'", "activate_wildcard": "false"}' \
@oliveratgithub
oliveratgithub / New Movies.m3u
Created May 2, 2018
Example .m3u-Playlist for playing content on WD TV and WD TV Live multimedia hub
View New Movies.m3u
#EXTM3U
#EXTINF:180,Surftrip to Spain 2018
Movies/Holidays/Surfing/Surfing Spain 2018.mp4
#EXTINF:180,Documentary about Whales
Documentary/Animals/whales_docu.avi
#EXTINF:180,Downhill in the mountains last week (GoPro)
Movies/Biking/Mountain Downhill Action (GoPro 4k).mp4
#EXTINF:180,School play summer 2015
Movies/Kids/School play at middleschool - June 2015.avi
@oliveratgithub
oliveratgithub / mamp-sql-dump-export.sh
Created Jan 6, 2017
MAMP MySQL dump export using Terminal.app in macOS
View mamp-sql-dump-export.sh
$ cd /Applications/MAMP/Library/bin/
$ ./mysqldump --host=localhost -uroot -proot source_database > ~/Desktop/database_name-dump.sql
@oliveratgithub
oliveratgithub / readme.md
Created Dec 11, 2018
Moving a Git repository from BitBucket to GitHub
View readme.md

Pre-requisites

A new, empty Git Repository has to be created on GitHub.com (do not initialize it with a Readme or alike, when asked!)

How-to migrate Git Repository to GitHub

$ cd /path/to/project
$ git remote add upstream https://github.com/[account]/[repository].git
$ git push upstream master
$ git push --tags upstream
@oliveratgithub
oliveratgithub / Add as new Reminder.scpt
Last active Feb 21, 2019
Add selected Text as new Reminder in Reminders.app
View Add as new Reminder.scpt
on run {input, parameters}
-- This code comes from http://raduner.ch/blog/
-- To be used with an Automator Service
-- ------------------------------------------------
set inputText to input as string
tell application "Reminders"
set newremin to make new reminder
set name of newremin to inputText
end tell
@oliveratgithub
oliveratgithub / mamp-sql-dump-import.sh
Last active Apr 24, 2019
MAMP MySQL dump import using Terminal.app in macOS
View mamp-sql-dump-import.sh
$ cd /Applications/MAMP/Library/bin/
$ ./mysql --host=localhost -uroot -proot target_database < ~/Desktop/database_name-dump.sql