Skip to content

Instantly share code, notes, and snippets.

@drunkensouljah
drunkensouljah / 49telefonnummer.scpt
Created September 13, 2018 20:40
[Formatier Kontakte] Fügt +49 vor jede Telefonnummer #macos #applescript
set vorwahl to "+49"
tell application "Contacts"
repeat with aPerson in people
set thePhones to phones of aPerson
if thePhones is not {} then
set errorList to {}
repeat with aPhoneNumber in thePhones
set theNumber to value of aPhoneNumber
if (characters 1 thru 1 of theNumber) as string is "0" then
@drunkensouljah
drunkensouljah / jekyll.html
Created August 8, 2018 17:23
[Jekyll Date Format] German Date in Jekyll #jekyll
<small>
<time datetime="{{ post.date }}" class="blogpost-time"><!-- Whitespace added for readability -->
{% assign m = post.date | date: "%-m" %}
{{ post.date | date: "%-d" }}.
{% case m %}
{% when '1' %}Januar
{% when '2' %}Februar
{% when '3' %}M&auml;rz
{% when '4' %}April
{% when '5' %}Mai
@drunkensouljah
drunkensouljah / disableusername.sh
Created July 22, 2018 19:50
[Disable username] Don't show user name in #chrome #macos
# Open Terminal and copy a blank space to your clipboard
# https://superuser.com/a/1152506
echo '\u200b' | pbcopy
# Go to Chrome -> Click on the avatar menu, edit the name, paste from the clipboard
!/bin/sh
#
# Creates a random string with characters from [A-Za-z0-9]
#
# Usage: ./random.sh length
#
LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | dd bs="${1?}" count=1 2>/dev/null
echo
@drunkensouljah
drunkensouljah / cleanup.sh
Created July 7, 2018 21:44
[Cleanup] Cleanup script for macos #macos
#!/bin/bash
SECONDS=0
#Check if running as root and if not elevate
amiroot=$(sudo -n uptime 2>&1| grep -c "load")
if [ "$amiroot" -eq 0 ]
then
printf "Maid Service Require Root Access. Please Enter Your Password.\n"
sudo -v
printf "\n"
@drunkensouljah
drunkensouljah / add-spacer.sh
Last active July 4, 2018 19:54
[Dock Spacer] Add a spacer on the macos dock #macos
# App side:
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# On the document side:
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
@drunkensouljah
drunkensouljah / site-plex.css
Last active July 2, 2018 16:00
[Nativefier draggable header] --inject site.css #nativefier #customcss
/* site.css */
/* navbar is draggable... */
nav-bar {
-webkit-app-region: drag;
}
/* but any buttons inside the header shouldn't be draggable */
nav-bar button {
-webkit-app-region: no-drag;
@drunkensouljah
drunkensouljah / workflow-install.py
Created October 29, 2017 02:08 — forked from deanishe/workflow-install.py
Script to install/symlink Alfred workflows. Useful for workflow developers.
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2013 [email protected].
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@drunkensouljah
drunkensouljah / README-Template.md
Created June 2, 2017 16:26 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

#coding: utf-8
import console
import keychain
import pickle
login = keychain.get_password('pinboard.in','pythonista')
if login is not None:
user, pw = pickle.loads(login)
else: