Skip to content

Instantly share code, notes, and snippets.

View nick96's full-sized avatar
☁️
Chilling in the cloud

Nick Spain nick96

☁️
Chilling in the cloud
View GitHub Profile
@nick96
nick96 / lldb_cheat_sheet.md
Created January 29, 2017 09:26 — forked from ryanchang/lldb_cheat_sheet.md
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@nick96
nick96 / c99-to-c89-for-loop-regexp.vim
Last active May 27, 2017 05:29
Coded up an assignment in C99 but the uni server is only C89. One of the main issues was declaring counters in the for-loop. This the regexp I used in VIM to move counteres outside.
" This was a massive help for me cause I could just run one command on a file and it would compile to C89.
" Hopefully this is useful to anyone who runs into the same problem :)
" It's a bit long winded so I put an explanation below:
" 1 = spacing, this allows the counter declaration to be easily indented the same amount no matter the
" indentation.
" 2 = 'for ('
" 3 = the counter type
" 4 = is for if the counter is pointer, like if you're iterating over a linked list
" 5 = the counter variable name
" 6 = the rest of the for-loop
@nick96
nick96 / open-app-osx.el
Last active May 27, 2017 05:27
Open an application from Emacs (OSX)
(defun nick/osx-open-app ()
"Open an application in OS X."
(interactive)
(shell-command (format "open -a %S" (read-string "Application: "))))
@nick96
nick96 / cp-many-files.sh
Created June 8, 2017 07:41
Copy multiple files of the same extension from one directory to another
# Requires find and xargs from GNU's findutils
# Just another example of the joys of composability in the UNIX philosophy
find <src-directory> -name *.<extension> -print0 | xargs -0 -I % cp % <dst-directory>
# Breakdown
# find -- from findutils, does what is says on the tin
# -name -- File name(s) to find, in this case we used the shell glob '*' to get any files with <extension>
# -print0 -- Separate files with a NULL byte
#
@nick96
nick96 / config.log
Last active September 1, 2017 11:53
Output of export and contents of config.log for debugging Irssi build
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by irssi configure 1.1-head, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
@nick96
nick96 / dht11-test.ino
Last active September 1, 2017 15:25
Code snippets for blog
/* Code testing out the DHT11 Temperature and Humidity sensor */
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
@nick96
nick96 / it_project_motivational_model.png
Last active August 1, 2019 08:07
IT Project Lect 1 notes
it_project_motivational_model.png

Keybase proof

I hereby claim:

  • I am nick96 on github.
  • I am nspain (https://keybase.io/nspain) on keybase.
  • I have a public key ASDtVLAsYEm_YUuiI1MJbhFdGv1AqPPRg61m5a9IltTEUgo

To claim this, I am signing this object:

@nick96
nick96 / whoami.nomad
Created March 18, 2021 12:57
Example nomad job
job "whoami" {
datacenters = ["dc1"]
type = "service"
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "3m"
progress_deadline = "10m"
auto_revert = false
@nick96
nick96 / crash.log
Last active March 20, 2021 01:55
Terraform crash output
Error: rpc error: code = Unavailable desc = transport is closing
panic: runtime error: invalid memory address or nil pointer dereference
2021-03-20T12:55:02.730+1100 [DEBUG] plugin.terraform-provider-segfault: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x165d902]
2021-03-20T12:55:02.730+1100 [DEBUG] plugin.terraform-provider-segfault:
2021-03-20T12:55:02.730+1100 [DEBUG] plugin.terraform-provider-segfault: goroutine 66 [running]:
2021-03-20T12:55:02.730+1100 [DEBUG] plugin.terraform-provider-segfault: github.com/nick96/terraform-provider-segfault/segfault.dataSegfaultRead(0x188ccc8, 0xc00068e480, 0xc000698500, 0x0, 0x0, 0xc00059a410, 0xc0001e9948, 0x100f818)
2021-03-20T12:55:02.730+1100 [DEBUG] plugin.terraform-provider-segfault: /Users/nicholasspain/devel/personal/terraform-provider-segfault/segfault/provider.go:29 +0x2