Skip to content

Instantly share code, notes, and snippets.

@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 / Batch File Rename.scpt
Last active Jan 19, 2021
Simple AppleScript to easily batch rename multiple files sequentially. GUI asks user to select files and input a name before renaming.
View Batch File Rename.scpt
-- 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 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 / prettyearthimage.html
Last active May 12, 2020
Google Pretty Earth: Random Image Link Generator (HTML)
View prettyearthimage.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 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 / ddns_updater.py
Created Nov 3, 2015
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)
View ddns_updater.py
#!/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 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 / index.html
Last active Dec 21, 2020
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.
View index.html
<!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/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<!--[if lt IE 9]>
@oliveratgithub
oliveratgithub / made-with-love.html
Last active Jan 20, 2021
Various HTML-snippets to add "Made with love" to your website
View made-with-love.html
<!-- Example #1 - no styling -->
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
<!-- Example #3 - CSS-style class for ❤ -->
<style>.heart{color:#e25555;}</style>
Made with <span class="heart"></span> in Switzerland
You can’t perform that action at this time.