Skip to content

Instantly share code, notes, and snippets.

d3js Multiline chart with brushing and mouseover

#!/usr/bin/env python
"""
- read subprocess output without threads using Tkinter
- show the output in the GUI
- stop subprocess on a button press
"""
import logging
import os
import sys
from subprocess import Popen, PIPE, STDOUT
@gniemetz
gniemetz / Doubleclickable Example
Created March 23, 2017 21:23
Pashua Doubleclick Example
#!/usr/bin/env bash
PS4='+(${BASH_SOURCE:-}:${LINENO:-}): ${FUNCNAME[0]:+${FUNCNAME[0]:-}(): }'
# script path name
declare -r SCRIPT_PN="${0%/*}"
# script filename
declare -r SCRIPT_FN="${0##*/}"
declare -r APP_PN="${SCRIPT_PN/%\/${SCRIPT_FN}.app\/Contents\/MacOS/}"
declare -r APP_MACOS_PN="${APP_PN}/${SCRIPT_FN}.app/Contents/MacOS"
declare -r APP_RESOURCES_PN="${APP_PN}/${SCRIPT_FN}.app/Contents/Resources"
@gniemetz
gniemetz / Post-install script
Created August 2, 2017 14:24
Pre-/Postinstall script for installing Acrobat XI/DC/2015/2017 via munki
#!/usr/bin/env bash
PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
### customize parameters here
# show debug messages
Debug=${1:-false}
# the languages for the user templates
declare -a UserTemplateLanguageArray
UserTemplateLanguageArray[${#UserTemplateLanguageArray[@]}]="English.lproj"
UserTemplateLanguageArray[${#UserTemplateLanguageArray[@]}]="German.lproj"
#!/usr/bin/python
import AppKit
import Foundation
def notify(title, subtitle, info_text, sound=False, appImage=None, contentImage=None, delay=0):
notification = Foundation.NSUserNotification.alloc().init()
notification.setTitle_(title)
notification.setSubtitle_(subtitle)
notification.setInformativeText_(info_text)
if appImage:
@gniemetz
gniemetz / stars.sh
Last active April 14, 2021 13:21 — forked from sebble/stars.sh
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-gniemetz}
declare -i PER_PAGE=100
declare -r ANSWER="$(
curl \
-s `# Silent or quiet mode. Don't show progress meter or error messages.` \
-I `# (HTTP FTP FILE) Fetch the headers only!` \
"https://api.github.com/users/${USER}/starred?per_page=1"
)"