Skip to content

Instantly share code, notes, and snippets.

<html ><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><meta name="viewport" content="initial-scale=0.75">
<style type="text/css">
.bugviewWidth { width: 757px; }
div.ixBug { width: 187px; }
#bugviewContainerSide { width: 170px; }
.bugFields,.bugevents { margin-left: 192px; }
html > body {
@pestophagous
pestophagous / gdb_cmd
Last active September 14, 2015 21:11
gdb command file
#!/bin/bash
# ------- NOTE: this is ***NOT*** (not not not) a bash file. However, i added the bin/bash line to get better highlighting in emacs.
# note that INSERT of libgmalloc makes the app run SLOWER !!!
#set environment DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.B.dylib
# WATCHPOINT.
# (gdb) awatch -location m_extraActionTimeLimitUnitTracker
# Hardware access (read/write) watchpoint 4: *(int *) 4423742944
# it worked with awatch and watch
@pestophagous
pestophagous / DNC_pre-commit.png
Last active September 14, 2015 21:33
rename this to .git/hooks/pre-commit inside your git repo to prevent accidental commits that you tagged as DNC (do-not-commit)
DNC_pre-commit.png
[user]
email = [email protected]
name = pestophagous
[color]
ui = auto
[color "diff"]
new = blue
commit = blue
[color "status"]
added = black bold
@pestophagous
pestophagous / profile.sh
Created September 14, 2015 21:51
put in bash .profile to see git branch name as part of PS1 prompt
# write a function to compute the current git branch
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
} # why is the ending with the > and the extra space not working??
# set the PS1 variable
PS1="$PS1\[\e[0;33;34m\]\$(parse_git_branch)\[\e[0;0m\]"
@pestophagous
pestophagous / rudimentary.js
Created October 4, 2015 05:41
guts of the rudimentary 'pager' (aka slideshow) type extension
var somespecialthing = -1;
var superarraything = [
"2011-November/000089.html",
"2011-November/000090.html",
"2011-November/000091.html",
"2011-November/000092.html",
"2011-November/000093.html",
"2011-November/000094.html",
@pestophagous
pestophagous / go-in-emacs-cheatsheet.el
Last active September 2, 2021 22:20
scratch pad of various commands to recall
(setq mybuild-command "go build -v main.go && go test -v ./...")
(setq mybuild-command "go test -v github.com/practicum/sandbox/...")
(setq mybuild-command "go build -v github.com/practicum/sandbox/executables/cli/... && go test -v github.com/practicum/sandbox/...")
; run the go build from "high" in the folder tree, so you see longer paths in the compiler errors:
(setq mybuild-dir "/Users/someone/")
; available because of edits I made in go-mode.el (see bottom)
; M-x j (open go definition in this same window)
@pestophagous
pestophagous / disatos.sh
Created October 14, 2015 20:14
runs on mac. (uses launchctl). hide something, but set a task to auto-restore in 15 minutes. (for atos. could be made more general.)
#!/bin/bash
echo "about to run 'sudo launchtl list', so you might be prompted for sudoer password!"
CHECK_ATRUN=`(sudo launchctl list | grep atrun | wc -l)`
if [ "$CHECK_ATRUN" -ne "1" ]; then
echo ""
echo "Refusing to run the script."
echo ""
@pestophagous
pestophagous / scratchpad.txt
Created November 22, 2016 22:11
scratchpad
chicken scratch