Skip to content

Instantly share code, notes, and snippets.

View ysndr's full-sized avatar

Yannik Sander ysndr

View GitHub Profile
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix-prefetch-scripts curl jshon jq
set -e
json="{}"
add() { json=$(jshon "$@" <<<"$json"); }
rm -rf overlay/upstream
mkdir -p overlay/upstream
GET() {
@gravitylow
gravitylow / codesign_gdb.md
Last active April 16, 2024 02:18 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@kristopherjohnson
kristopherjohnson / hanoi.hs
Last active August 12, 2020 22:13
Towers of Hanoi in Haskell
#!/usr/bin/env runhaskell
-- Print sequence of moves for 4 discs from pin "A" to pin "C"
main = do putStrLn "Move stack of four discs from A to C:"
printNumberedList moves
where moves = hanoi 4 "A" "C" "B"
-- Return list of moves for moving stack of N discs from one pin to another
hanoi :: Show a => Int -> a -> a -> a -> [String]
hanoi 0 _ _ _ = []
Cracking the coding interview, careercup
Data Structures
1. Integer
– find number of 1s
– next largest smaller
– smallest larger number
– determine if is palindrom
– itoa, atoi