Skip to content

Instantly share code, notes, and snippets.

@zdoc01
zdoc01 / custom-prompt.sh
Created May 23, 2023 14:54
Custom Prompt with Git Integration for ZSH
#######################
# start: git in prompt
#######################
# allow use of __git_ps1
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
# enable git unstaged indicators - set to a non-empty value
GIT_PS1_SHOWDIRTYSTATE="."
@zdoc01
zdoc01 / tasks.json
Created June 8, 2022 15:16
VSCode c++ tasks
{
// See https://code.visualstudio.com/docs/cpp/config-clang-mac
"version": "2.0.0",
"tasks": [
{
"label": "create build directory",
"type": "shell",
"command": "mkdir -p ${workspaceFolder}/build/",
"group": "build"
},
@zdoc01
zdoc01 / get-coordinates.lua
Created September 1, 2019 18:20
WoW Classic Macro - Get player coordinates
/script SetMapToCurrentZone()
/script map=C_Map.GetBestMapForUnit("player")
/script pos=C_Map.GetPlayerMapPosition(map, "player")
/script x,y=pos:GetXY()
/script DEFAULT_CHAT_FRAME:AddMessage(string.format("%s [ %.1f, %.1f ]",GetZoneText(),x*100,y*100))
@zdoc01
zdoc01 / toggle-outlook-notifications.scpt
Created July 11, 2017 15:05
Toggle Microsoft Outlook notifications and unread count badge for Mac OS X
tell application "System Preferences"
quit
delay 1
end tell
tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.notifications"
reveal pane id "com.apple.preference.notifications"
@zdoc01
zdoc01 / cherrypick.sh
Created May 13, 2017 17:57
cherry-pick commits from another repository
#!/bin/bash
USAGE="Usage: cherrypick <path_to_repo> <commit_hash>"
if [ -z $1 ] || [ -z $2 ] # length of string = 0?
then
echo $USAGE
else
# The git format-patch command creates a patch from path_to_repo's
# commit specified by its SHA (-1 for one single commit alone).
@zdoc01
zdoc01 / index.js
Last active January 24, 2016 01:29 — forked from max-mapper/index.js
requirebin sketch
var term = require('hypernal')()
var tablify = require('tablify').tablify
var request = require('browser-request')
var url = require('url')
term.appendTo(document.body)
// style fake terminal
var termEl = term.term.element
termEl.style['font'] = '13px Monaco, mono'
@zdoc01
zdoc01 / index.js
Last active January 24, 2016 18:04
requirebin sketch test
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var _ = require('lodash');
document.write(JSON.stringify(_.extend({}, {'test': 'hi'}, {'test': 'yo'})));
@zdoc01
zdoc01 / .bash_profile
Last active January 3, 2019 23:14
Custom Bash Prompt with Git Integration
#######################
# start: git in prompt
#######################
# allow use of __git_ps1
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
# enable git unstaged indicators - set to a non-empty value
GIT_PS1_SHOWDIRTYSTATE="."