Skip to content

Instantly share code, notes, and snippets.

View oliveratgithub's full-sized avatar

Oliver oliveratgithub

View GitHub Profile
@oliveratgithub
oliveratgithub / Add as new Reminder.scpt
Last active February 21, 2019 10:23
Add selected Text as new Reminder in Reminders.app
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 / Batch File Rename.scpt
Last active November 2, 2024 17:40
Simple AppleScript to easily batch rename multiple files sequentially. GUI asks user to select files and input a name before renaming.
-- This code comes from https://gist.github.com/oliveratgithub/
-- Open in AppleScript Editor and save as Application
-- ------------------------------------------------------------
--this is required to break the filename into pieces (separate name and extension)
set text item delimiters to "."
tell application "Finder"
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list
display dialog "New file name:" default answer ""
set new_name to text returned of result
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file.
@oliveratgithub
oliveratgithub / Add Reminder to Wunderlist.scpt
Last active November 13, 2015 16:37
AppleScript to add a Text selection as a new Reminder to Wunderlist
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 / prettyearthimage.html
Last active May 12, 2020 04:05
Google Pretty Earth: Random Image Link Generator (HTML)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Google Pretty Earth - Random Image Link</title>
</head>
<body onload="printRandomPrettyearthLink()"><body>
<script>
var prettyearthImage = '';
var prettyearthBaseUrl = 'https://www.gstatic.com/prettyearth/assets/full/';
@oliveratgithub
oliveratgithub / Apple_find_city.asp.xml
Last active September 21, 2015 23:12
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
<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 October 5, 2015 13:31
Vanilla Community Forum custom Theme hook to add custom apple-touch-icons and favicon to your site
<?php if (!defined('APPLICATION')) exit();
class MythemenameThemeHooks implements Gdn_IPlugin
{
/**
* No setup required
*/
public function Setup() { }
/**
@oliveratgithub
oliveratgithub / ddns_updater.py
Created November 3, 2015 23:47
TwoDNS.de / Two-DNS.de automatic Dynamics DNS updater using HTTP API calls (works with any other DDNS Service, allowing IP updates via HTTP API calls)
#!/usr/bin/env python
# encoding: utf-8
import subprocess, string, json, urllib
# DISABLED: import httplib, base64
"""
In order to run this Python script, make it executable first using:
chmod +x <filename>.py
And then run it using
@oliveratgithub
oliveratgithub / ddns_updater.sh
Created November 5, 2015 14:28
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)
#!/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 "[email protected]:api_token" \
-H "Content-Type: application/json" \
--data '{"ip_address":"'$my_ext_ip'", "activate_wildcard": "false"}' \
@oliveratgithub
oliveratgithub / index.html
Last active November 26, 2023 08:11
Simple, quick & standalone HTML5 responsive placeholder Website. Runs by simply copy-paste the whole code without any additional resource files. It's based on PureCSS.io with jQuery containing a fullstretch-background image plugin and a date-time countdown; kudos to unsplash.it for beautiful placeholder images.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dummy Page</title>
<meta name="description" content="Simple, quick, standalone responsive placeholder Website without any additional resources">
<meta name="author" content="https://gist.github.com/oliveratgithub">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<!--[if lt IE 9]>
@oliveratgithub
oliveratgithub / made-with-love.html
Last active November 11, 2024 18:59
Various snippets to add "Made with love" to your website using HTML, CSS and JavaScript
<!-- Example #1 - no styling -->
Made with ❤ in Switzerland
Made with ♥ in Switzerland
Made with ♡ in Switzerland
Made with ❤️ in Switzerland
Made with ♥️ in Switzerland
<!-- Example #2 - inline-styled ❤ -->
Made with <span style="color: #e25555;">&#9829;</span> in Switzerland
Made with <span style="color: #e25555;">&hearts;</span> in Switzerland