Skip to content

Instantly share code, notes, and snippets.

Making an impact

Mark McDonnell Integralist

Making an impact
View GitHub Profile
Integralist / Let
Last active Nov 24, 2020
Clojure destructuring using `let` (which allows local storage inside of a function, we would say a local "variable" but that would be misleading because all data is immutable in Clojure)
View Let

In Clojure you can apply destructuring within either a let binding list; function parameter list or even a macro.

A simple example would be:

(def coords [5 7]) ; define a symbol "coords" that points to a vector [5 7]
(let [[x y] coords] (println "x:" x "y:" y))
; => x: 5 y: 7
Integralist / Google Doc Code
Last active Nov 20, 2020
[Google Doc Code Syntax] #google #doc #code #syntax #brew #highlight
View Google Doc Code
brew install highlight

Now copy some code to your clipboard, followed by running:

pbpaste | highlight --syntax=go -O rtf | pbcopy
Integralist / Github GPG Commit Signing
Last active Nov 18, 2020
[Github GPG Commit Signing Key] #gpg #github #commit #sign #key
View Github GPG Commit Signing
gpg --full-generate-key
git config --global --edit
Integralist / sed replace content across multiple files.bash
Last active Nov 18, 2020
[sed replace content across multiple files] #sed #replace #global #multiple #files #bash
View sed replace content across multiple files.bash
gsed -i 's/metrics.NewWriter(/metrics.NewLegacyWriter(/' **/*.go
# UPDATE: glob/wildcard doesn't appear to work any more, needs to be individual file streams
find . -type f -name *.go -exec gsed -i 's/foo/bar/' {} \;
Integralist / Populate (or update) with new
Created Nov 18, 2020
[Populate (or update) with new package] #go #golang #dev #pkg
View Populate (or update) with new

If you want a project to appear in then visit the expected page and click on the "Request ..." button.


I clicked on the button "Request" and it started to populate.

Integralist / GitHub
Last active Nov 13, 2020 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article:
View GitHub
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
# Example...
Integralist / Security Types - Encryption, Hashing,
Created Nov 12, 2020
[Security Types - Encryption, Hashing, Signatures] #security #sec #encryption #hash #signatures #hmac
View Security Types - Encryption, Hashing,
  • Encryption helps ensure confidentiality.
  • Hashing can help ensure integrity.
  • Digital signatures or message authentication codes (MAC, including keyed hashing such as HMAC) can be used to verify authenticity.
Integralist / Ruby RVM.bash
Last active Nov 11, 2020
[Ruby RVM] #ruby #rvm
View Ruby RVM.bash
# install rvm
curl -sSL | bash
# lookup available ruby interpreters
rvm list known
# install specific ruby version
Integralist / CLI terminology flags vs arguments vs
Created Nov 11, 2020
[CLI terminology flags vs arguments vs options] #cli #terminology #flags #arguments #args #options
View CLI terminology flags vs arguments vs

Example binary execution:

<command> <flags|options> <arguments>

Note: 'options' was historically used to suggest the input as being 'optional' and so it typically maps to .

Integralist / 1. WindowMock.js
Last active Nov 9, 2020
Mocking the `window` object in JavaScript unit tests
View 1. WindowMock.js
'module/bootstrap', // this is jQuery and PubSub libs
], function (lib) {
var windowMock = {
resizeSet: false, // set within the fake `lib` object below
createFakeWindow: function(width, height) {
return {
document: {
documentElement: {
You can’t perform that action at this time.