Skip to content

Instantly share code, notes, and snippets.

View oliveratgithub's full-sized avatar

Oliver oliveratgithub

View GitHub Profile
@oliveratgithub
oliveratgithub / MailMergeSaveEachRecordToFile.vba
Created May 9, 2017 20:31
VBA macro for Microsoft Word (Mac + Windows) to Mail Merge each record into separate documents. Execute the following VBA Macro on your Office Word Mail Merge template to have Word generate & save every record into a single file. More information: https://swissmacuser.ch/microsoft-word-mail-merge-into-single-documents/
'More information & instructions:
'https://swissmacuser.ch/microsoft-word-mail-merge-into-single-documents/
Option Explicit
Sub MailMergeSaveEachRecordToFile()
'
' Save each single Mail Merge Record into a seperate Document
'
Dim rec, lastRecord As Integer
Dim docNameField, strDocName, savePath As String
@oliveratgithub
oliveratgithub / curl-crawler.sh
Last active November 23, 2023 01:49
Unix Shell-Script to crawl a list of website URLs using curl
#!/bin/sh
timezone="Europe/Zurich"
# List of valid timezones: wikipedia.org/wiki/List_of_tz_database_time_zones
script="${0##*/}"
rootdir=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
logfile="$script.log"
log="$rootdir/$logfile"
now=$(TZ=":$timezone" date)
# Uncomment 'mailto=' (remove #) to enable emailing the log upon completion
#mailto="your@email.com"
@oliveratgithub
oliveratgithub / mamp-sql-dump-import.sh
Last active April 24, 2019 09:51
MAMP MySQL dump import using Terminal.app in macOS
$ cd /Applications/MAMP/Library/bin/
$ ./mysql --host=localhost -uroot -proot target_database < ~/Desktop/database_name-dump.sql
@oliveratgithub
oliveratgithub / mamp-sql-dump-export.sh
Created January 6, 2017 20:42
MAMP MySQL dump export using Terminal.app in macOS
$ cd /Applications/MAMP/Library/bin/
$ ./mysqldump --host=localhost -uroot -proot source_database > ~/Desktop/database_name-dump.sql
@oliveratgithub
oliveratgithub / made-with-love.html
Last active April 19, 2024 17:06
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
@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/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<!--[if lt IE 9]>
@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 "mail@host.tld:api_token" \
-H "Content-Type: application/json" \
--data '{"ip_address":"'$my_ext_ip'", "activate_wildcard": "false"}' \
@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 / 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 / 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"/>