Skip to content

Instantly share code, notes, and snippets.

View oliveratgithub's full-sized avatar

Oliver oliveratgithub

View GitHub Profile
@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 / batch change filename to lowercase.ps1
Created December 18, 2019 12:30
Batch file rename using PowerShell on Windows: add filename prefix, change file name to all lowercase, and so on.
<# Batch change all PDF file names to lowercase letters within a specific directory #>
dir C:\PATH\TO\FOLDER\*.pdf | Rename-Item -NewName {$_.Name.ToLower()}
@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 / 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 / my.cnf
Created September 27, 2019 21:23
MAMP MySQL 5.7 disable strict mode. Add file to /MAMP/conf/
[client]
#socket = /Applications/MAMP/tmp/mysql/mysql.sock
[mysqld]
max_allowed_packet = 64M
table_open_cache = 2000
sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
@oliveratgithub
oliveratgithub / LNGoogleCalSync-Launcher.applescript
Created May 28, 2017 21:20
AppleScript to launch the "Lotus Notes to Google Calendar Synchronizer"-GUI (LNGoogleCalSync) in the background on macOS
---- This AppleScript is written to work with the Lotus Notes to Google Calendar Synchronizer on macOS
---- http://lngooglecalsync.sourceforge.net
---- AppleScript by oliveratgithub
-- Change below path to match the location of the "lngsync.sh" file!
property lngsyncPath : "/Applications/LNGoogleCalSync/"
---- You don't need to care about the code below this line ;-)
property lngsyncFilePath : lngsyncPath & "lngsync.sh"
@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 / 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 / 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 / readme.md
Created December 11, 2018 10:20
Moving a Git repository from BitBucket to GitHub

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