Skip to content

Instantly share code, notes, and snippets.

View ndbroadbent's full-sized avatar

Nathan Broadbent ndbroadbent

View GitHub Profile
@ndbroadbent
ndbroadbent / getTotps - show image in console.js
Last active July 23, 2021 14:02 — forked from nmurthy/getTotps.js
export authy totp codes, show QR codes in the console
/* base32 */
/*
Copyright (c) 2011, Chris Umbel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ndbroadbent
ndbroadbent / rubocop_pre_commit_hook
Last active July 7, 2018 20:14 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
ADDED_OR_MODIFIED = /A|AM|^M/
added_or_modified = `git status --porcelain`.split("\n").select do |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
end
filenames = added_or_modified.map do |file_name_with_status|
file_name_with_status.split(' ')[1]
@ndbroadbent
ndbroadbent / overlay2.sh
Last active March 11, 2018 22:55 — forked from cjbottaro/overlay.sh
Convert ECS Optimized AMI to use overlay/overlay2
set -e
# Stop the docker daemon
/etc/init.d/docker stop
# Configure ECS Agent
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/automated_image_cleanup.html
cat > /etc/ecs/ecs.config << "EOF"
ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=1h
@ndbroadbent
ndbroadbent / rn-i18n-locale-identifiers.csv
Last active April 18, 2024 11:43 — forked from JaseHadd/ioslocaleidentifiers.csv
React Native i18n Locale Identifiers
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@ndbroadbent
ndbroadbent / react-native-i18n-locale-identifiers.csv
Last active March 16, 2018 08:13 — forked from jacobbubu/ioslocaleidentifiers.csv
React Native i18n Locale Identifiers
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
ar Arabic
ar-AE Arabic (United Arab Emirates)
@ndbroadbent
ndbroadbent / readme.md
Created January 31, 2012 02:52 — forked from mislav/readme.md
CLI tool that checks the build status of current branch on Travis CI

Check build status of a project on the command line

Install (copy & paste):

curl -sL https://raw.github.com/gist/1708408/travis.rb > ~/bin/travis-ci \
  && chmod +x ~/bin/travis-ci

gem install hub | tail -2
ruby -e 'require "json"' 2&gt;/dev/null || gem install json
@ndbroadbent
ndbroadbent / .gitattributes
Created January 11, 2012 08:35 — forked from tpope/.gitattributes
Fewer conflicts in your Rails apps
Gemfile.lock merge=bundleinstall
db/schema.rb merge=railsschema
@ndbroadbent
ndbroadbent / .irbrc
Created December 10, 2011 06:39 — forked from cpetschnig/.irbrc
IRB customization: load wirble, looksee and awesome_print; cheat bundler
require 'rubygems'
@irb_extensions = []
def require_with_bundler_fallback(gem_name, load_file = nil)
load_file ||= gem_name
begin
require load_file
rescue LoadError => e
gem_paths = []