Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver oliveratgithub

View GitHub Profile
@oliveratgithub
oliveratgithub / botconfigs.py
Last active Nov 26, 2020
Bot script for Telegram Messenger to publish stock market price updates - Python 3.x compatible and can run as a nohup service
View botconfigs.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ~~~~~
# Telegram Bot API configs for stock_notifications.py
# ~~~~~
token=''
chat=''
@oliveratgithub
oliveratgithub / socialnetworkimagesizes.js
Last active Sep 28, 2020
Social media networks image sizes as JSON and JavaScript lists – Contains image sizes for all major social networks and messengers as of 2020 (Facebook, Twitter, Instagram, Tik Tok, Telegram, WhatsApp, and more)
View socialnetworkimagesizes.js
let socialnetworkimagesizes = {
'facebook': {
'profile': {
'Profile picture': { 'w': 180, 'h': 180 }
,'Cover photo': { 'w': 820, 'h': 312 }
}
,'content': {
'Timeline image': { 'w': 1200, 'h': 630 }
,'Highlighted image': { 'w': 1200, 'h': 717 }
,'Link - rectangular': { 'w': 1200, 'h': 628 }
@oliveratgithub
oliveratgithub / batch change filename to lowercase.ps1
Created Dec 18, 2019
Batch file rename using PowerShell on Windows: add filename prefix, change file name to all lowercase, and so on.
View batch change filename to lowercase.ps1
<# 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 / unix-aws-ses-testmail.txt
Created Dec 13, 2019
SMTP test email using AWS Simple Email Service (SES) on UNIX openssl s_client or Windows PowerShell
View unix-aws-ses-testmail.txt
# Source: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp-client-command-line.html
# X-SES-CONFIGURATION-SET is optional
EHLO yourdomain.com
AUTH LOGIN
base64 encoded Smtp Username
base64 encoded Smtp Password
MAIL FROM: from@yourdomain.com
RCPT TO: email@anydomain.com
DATA
#X-SES-CONFIGURATION-SET: YourSESConfigSet
@oliveratgithub
oliveratgithub / my.cnf
Created Sep 27, 2019
MAMP MySQL 5.7 disable strict mode. Add file to /MAMP/conf/
View my.cnf
[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 / seo_meta.php
Last active Sep 2, 2019
PHP Regex to output SEO optimized «meta title» and «meta description» with valid characters only and utf8 support
View seo_meta.php
<?php
/** Raw content input */
$title = 'Begriff "Test"; zu weiteren gleichnamigen Bedeutungen siehe Test <Begriffsklärung>';
$description = 'Das Wort „Test“ kommt vom altfranzösischen test: Tiegel‚ Topf für alchemistische Versuche bzw. lateinisch testum, zu: testa = Platte, Deckel; (Ton)schale, Scherbe.';
/** SEO friendly content */
$seo_allowed_chars_pattern = '([^\w\s\p{L}.,;:!?\-\/\(\)\[\]…«»#@])';
$meta_title = mb_ereg_replace($seo_allowed_chars_pattern, '', $title);
$meta_description = mb_ereg_replace($seo_allowed_chars_pattern, '', $description);
/**
@oliveratgithub
oliveratgithub / readme.md
Created Jan 4, 2019
Configure the PHP CLI in macOS to use MAMP PHP binaries
View readme.md

Pre-requisites

Find MAMP's installed PHP version(s) you want to use the PHP CLI for:

$ ls -l /Applications/MAMP/bin/php/

Configure PHP CLI in macOS to use MAMP's PHP

  1. First, open your local user's .bash_profile in edit mode, in order to add aliases for accessing the PHP CLI locally
$ pico ~/.bash_profile
@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 / alternate-hreflang.html
Last active Jul 19, 2019
International targeting SEO code snippets – Sitecore Symposium 2018 Handout. Sources: https://www.sitemaps.org/protocol.html and https://support.google.com/webmasters/answer/189077?hl=en
View alternate-hreflang.html
<link rel="alternate" hreflang="x-default" href="https://www.mysite.com/" />
<link rel="alternate" hreflang="de" href="https://www.mysite.com/de-de" />
<link rel="alternate" hreflang="en" href="https://www.mysite.com/en-de" />
<link rel="alternate" hreflang="es" href="https://www.mysite.com/es-es" />
<link rel="alternate" hreflang="fr" href="https://www.mysite.com/fr-fr" />
<link rel="alternate" hreflang="zh" href="https://www.mysite.com/zh-cn" />
<link rel="alternate" hreflang="zh-CN" href="https://www.mysite.com/zh-cn" />
<link rel="alternate" hreflang="en-US" href="https://www.mysite.com/en-us" />
<link rel="alternate" hreflang="de-DE" href="https://www.mysite.com/de-de" />
<link rel="alternate" hreflang="en-DE" href="https://www.mysite.com/en-de" />
@oliveratgithub
oliveratgithub / autoexec.cfg
Last active Aug 6, 2020
ioQuake3 – custom high definition configurations for best visual quality (Quake 3, Quake III Arena). This config file is featured on https://swissmacuser.ch/how-you-want-to-run-quake-iii-arena-in-2018-with-high-definition-graphics-120-fps-on-5k-resolution/
View autoexec.cfg
seta r_mode "-1"
seta r_customwidth "5120"
seta r_customheight "2880"
seta cg_fov "115"
seta cg_gunCorrectFOV "1"
seta cl_renderer "opengl2"
seta r_allowSoftwareGL "0"
seta r_ignoreGLErrors "1"
seta r_smp "1"
seta r_displayrefresh "0"
You can’t perform that action at this time.