Skip to content

Instantly share code, notes, and snippets.

@tednaleid
tednaleid / 1_macos_vscode_lldb_setup.md
Last active September 6, 2021 02:25
debugging pony with vscode + lldb

Debugging Pony with VSCode and lldb

The pony language reference has a debugging section that got me pointed in the right direction for getting VSCode set up and integrated with lldb.

There were a few steps that were glossed over in the instructions, but I eventually got everything working, including:

  • breakpoints (including conditional breakpoints)
  • current variable values (including evaluated Strings not pointers)
  • watch expressions
  • step debugging
@tednaleid
tednaleid / wexec.zsh
Last active August 10, 2019 21:28
wexec - shell function to allow easy iteration on a shell command, uses watchexec to re-run a command whenever the file is saved
# add to your .zshrc/.bashrc
# sets up "live reload"-like environment for for a single file
# will watch a file (create it if it doesn't exist), every time it is saved it will run a command
EDITOR=mvim # I use MacVim but switch this to whatever you use (something that'll be outside of the same terminal window)
function wexec() {
command -v watchexec >/dev/null 2>&1 || { echo "'watchexec' is required. e.g. brew install watchexec or cargo install watchexec" >&2; exit 1; }
if [[ -z $1 || "$1" == "--help" ]]; then
@tednaleid
tednaleid / gist:0982b620a022346a34d24a961c5bb517
Created June 15, 2017 00:29
karabiner 0.91.3 caps lock to ctrl when chorded or esc when pressed alone
// modified from http://brettterpstra.com/2017/06/14/full-hyper-key-functionality-restored-in-sierra/
// this makes caps lock turn into "left control" if pressed with another key
// and "escape" if pressed by itself. Requires karabiner elements 0.91.3 or higher to have
// the "to_if_alone" section. Place after "simple_modifications" in the ~/.config/karabiner/karabiner.json file
"complex_modifications": {
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift. Escape if no other key used.",
@tednaleid
tednaleid / gist:c4ed5ec8e047f1adb13c1dd333bbb2e2
Created March 24, 2017 05:29
shell commands for finding and deleting duplicate files based on md5sum of the file
# RUN AT YOUR OWN RISK, UNDERSTAND THE COMMANDS AND DO NOT RUN BLINDLY
This will find all the duplicate photos in a `raw_photos` directory.
create md5sum of all files (after `brew install coreutils`):
find raw_photos -type f -exec gmd5sum "{}" + > files.md5
then sort that and you can find the files where the md5sum (the first field) is repeated for spot-checking and comparison
@tednaleid
tednaleid / .gitconfig
Created March 10, 2017 18:26
`git pusho` command that pushes to origin and creates a clickable link to open a PR using upstream branch as merge target
[alias]
# clickable http link to github repo
repourl=!"echo https://$(git remote get-url --push origin | sed 's/git\\@\\(.*\\)\\.git/\\1/' | sed 's/:/\\//')"
# push out a feature branch with a clickable link for creating a pull request against your upstream origin branch
pusho = !git push origin $(git branchname) && echo "create a pull request at: $(git repourl)/compare/$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} | awk -F'/' '{print $NF}')...$(git branchname)?expand=1"
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service
#! /usr/bin/env groovy
import ratpack.exec.Downstream
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.exec.Promise
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('io.ratpack:ratpack-groovy:1.3.0')
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')