Skip to content

Instantly share code, notes, and snippets.

View plasticine's full-sized avatar
🐧
Hello? Is this thing on?

Justin Morris plasticine

🐧
Hello? Is this thing on?
View GitHub Profile
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@dergachev
dergachev / Docker-forward-ssh-agent.sh
Created May 15, 2014 17:51
Allows SSH Agent forwarding into docker container
# NB: the line with SSH_AUT_SOCK allows SSH Agent forwarding into docker container
# NB: umask 002 makes all newly created files group-writable
docker-run-with-agent:
docker run -t -i \
-v `pwd`/source:/srv/docker-jekyll/source/ \
-v `pwd`/deploy:/srv/docker-jekyll/deploy \
-v `dirname $(SSH_AUTH_SOCK)`:`dirname $(SSH_AUTH_SOCK)` -e SSH_AUTH_SOCK=$(SSH_AUTH_SOCK) \
-p 4000:4000 \
dergachev/docker-jekyll \
/bin/bash -c "umask 002; $(cmd) $(args)"
@progrium
progrium / consulkv
Created June 4, 2014 22:21
Consul KV client, depends on jq
#!/bin/bash
CONSUL="localhost:8500"
main() {
case "$1" in
info)
curl -s "$CONSUL/v1/kv/$2" | jq -r .[]
;;
get)
@JunichiIto
JunichiIto / alias_matchers.md
Last active September 5, 2025 14:24
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@pnc
pnc / observer.md
Last active April 1, 2025 21:38
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@joho
joho / buildbox_cloudwatch.sh
Created November 11, 2014 22:28
Script for publishing buildbox build wait times as an AWS cloudwatch metric
#!/bin/bash
#
# Publishes CloudWatch metrics about Buildbox queue length
set -e
API='https://api.buildbox.io'
BUILDS_ROUTE='v1/accounts/ACCOUNT_NAME/projects/PROJECT_NAME/builds'
# Determines whether a binary exists on the current $PATH
@kneath
kneath / books.md
Last active August 29, 2015 14:12
Books of 2014
  • The Currents of Space — Isaac Asimov
    Felt like the most Asimovian stereotype to date. Whodunnit to the max. But, a nice short enjoyable read that fits in with the rest of the Asimov universe.

  • Use of Weapons (Culture Book) — Iain Banks
    Read this one sober. It took me a while to get used to the way this book is written, but I definitely enjoyed it. A lot more about the Culture operatives (Contact / Special Circumstances) than the rest of the Culture universe.

  • Quiet: The Power of Introverts in a World That Can't Stop Talking — Susan Cain
    My favorite book of 2014. Helped me feel a lot more comfortable in my skin, make better decisions, and confident that there's nothing wrong with me just because I don't aspire to extrovert ideals.

  • The Man Who Ended The World — Jason Gurley

@bendc
bendc / functional-utils.js
Last active July 15, 2025 04:33
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@zampino
zampino / struct_extension.ex
Last active July 20, 2022 00:32
Elixir Extending a Struct
defmodule DSL do
defmacro extend_struct struct_mod, keyword do
quote do
defstruct Keyword.merge(Map.to_list(Map.from_struct(unquote(struct_mod).__struct__)), unquote(keyword))
end
end
end