Skip to content

Instantly share code, notes, and snippets.

View modius's full-sized avatar
🇦🇺
Busy disrupting.

Geoff Bowers modius

🇦🇺
Busy disrupting.
View GitHub Profile
@thewheat
thewheat / intercom_javascript_attributes.md
Last active May 11, 2021 15:13
Attributes for Intercom's client side Javascript integration used when installing the messenger https://developers.intercom.com/docs/js-installation

Javascript Installation Attributes

  • Intercom can be initialised with various ways For visitors
window.intercomSettings = { 
  app_id: YOUR_APP_ID
}

For Logged in users

@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@revett
revett / README.md
Last active November 7, 2016 11:36
Tutum Zero Downtime Re-deploy

Tutum Zero Downtime Re-deploy

cats.jpg

I tweeted Tutum last night asking if they're looking at implementing zero downtime re-deploys for a given service. Slightly surprised by their response as it seems like a critical feature if you want to use the service for a production environment.

"not a top priority, but by Spring :)"

As Tutum currently doesn't support graceful termination of containers within a service, I was experiencing a 5-10 second window of 503 errors, so decided to use the following hack (code below) until the feature is officially implemented.

@YesThatAllen
YesThatAllen / rake.rb
Last active December 15, 2020 13:14
Rake tasks in Discourse as of April 13, 2017
# /var/discourse# ./launcher enter app
# RAILS_ENV=production bundle exec rake -T
rake about # List versions of all Rails frameworks and the environment
rake add_topic_to_quotes # Add the topic to quotes
rake admin:create # Creates a forum administrator
rake admin:invite[email] # invite an admin to this discourse instance
rake api_key:get # generate api key if missing, return existing if already there
rake assets:clean[keep] # Remove old compiled assets
rake assets:clobber # Remove compiled assets
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@r10r
r10r / enable_dnsmasq_on_osx.sh
Last active October 11, 2019 04:27
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/vbox'
@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...