Skip to content

Instantly share code, notes, and snippets.

View marcransome's full-sized avatar

Marc Ransome marcransome

View GitHub Profile
@marcransome
marcransome / git-obj-walk.sh
Last active March 8, 2024 17:03
git-obj-walk.sh
#!/bin/bash
set +o pipefail
if (( $# != 1 )); then
echo "usage: $0 <ref>" >&2
exit 1
fi
if ! command -v git >/dev/null 2>&1; then
@marcransome
marcransome / get_concourse_bearer_token.sh
Last active February 6, 2024 15:00
Concourse OAuth bearer token retrieval
#!/bin/bash
required_env_vars=(
CONCOURSE_ENDPOINT
CONCOURSE_USERNAME
CONCOURSE_PASSWORD
)
for env_var in "${required_env_vars[@]}"; do
if [[ -z "$(printenv ${env_var})" ]]; then
@marcransome
marcransome / .Xresources
Last active June 17, 2022 16:25
xterm settings for XQuartz
! Font face and size
XTerm*faceName: mononoki
XTerm*faceSize: 12
! Window settings
XTerm.vt100.geometry: 112x40
! General colours
XTerm*highlightReverse: false
XTerm*highlightColor: #C1DDFF
@marcransome
marcransome / clippy.cow
Last active June 17, 2022 16:07
sure.fish
$the_cow = <<EOC;
|
v
__
/ \
| |
@ @
|| ||
|| ||
\___/
@marcransome
marcransome / git-vim-fix.md
Last active July 24, 2017 22:21
git commit error using vim 8.0.740+

Error:

$ git commit
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

Fix:

server {
listen 80;
server_name test.dev;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8080;
}
}
function proxy {
for env_var in http_proxy HTTP_PROXY https_proxy HTTPS_PROXY; do
export $env_var=''
done
export no_proxy="localhost,127.0.0.1"
}
proxy
function noproxy {
for env_var in http_proxy HTTP_PROXY https_proxy HTTPS_PROXY; do

Keybase proof

I hereby claim:

  • I am marcransome on github.
  • I am marcransome (https://keybase.io/marcransome) on keybase.
  • I have a public key ASBZWoIk_280bRa6txmK8vHF-LY5gdvGG24M18V52d7qQAo

To claim this, I am signing this object:

@marcransome
marcransome / dnsimple.sh
Last active January 2, 2016 16:49
DNSimple.com domain ALIAS update script
#!/usr/bin/env bash
EMAIL=""
API_TOKEN=""
DOMAIN_ID=""
RECORD_ID=""
EXTERNAL_IP="`curl http://rqst.io/ip | jgrep -s "ip"`"
curl -H "Accept: application/json" \
-H "Content-Type: application/json" \
@marcransome
marcransome / jp.fish
Last active December 20, 2015 07:49
A fish shell function that opens the default editor with a date prepended filename and the specified title for jekyll posts.
function jp -d "Open default editor with date prepended filename and specified title for jekyll posts."
set title (date +"%Y-%m-%d")
switch (count $argv)
case 0
echo "No post title was specified."
return 1
case 1
set lower_arg (echo $argv[1] | tr A-Z a-z)