Skip to content

Instantly share code, notes, and snippets.

View beastawakens's full-sized avatar
:shipit:

Ed Fricker beastawakens

:shipit:
View GitHub Profile
@beastawakens
beastawakens / gtm-intercom.js
Created January 22, 2016 14:33
Adding Google Tag Manager variables to intercomSettings
<script>
// app ID
var intercomSettings = {
app_id: "{{IC - Dynamic app ID}}"
};
// Verifies and cleans all GTM variables
function pushGTMVariablesToIntercom(gtmKey, gtmValue) {
if("{{User - Account - Type}}" != "Guest"){
if(gtmValue != null && gtmValue != "" && gtmValue != "undefined") {
<script>
var intercomSettings = {
app_id: "{{Intercom app ID}}"
};
(function() {var w = window;var ic = w.Intercom;if (typeof ic === "function") {ic('reattach_activator');ic('update', intercomSettings);} else {var d = document;var i = function() {i.c(arguments)};i.q = [];i.c = function(args) {i.q.push(args)};w.Intercom = i;var s = d.createElement('script');s.type = 'text/javascript';s.async = true;
s.src = 'https://widget.intercom.io/widget/{{Intercom app ID}}';
var x = d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);}})();
</script>
@beastawakens
beastawakens / example-docker-compose.yml
Created March 15, 2017 10:42
Getting Convox apps working with local .dev domains
version: "2"
services:
web:
build:
context: .
# Found the previous convox init using the 'convox/rails' image doesn't work due to the built-in nginx adding another layer of complexity. The new init using buildpacks is better.
command: bin/rails server -p $$PORT -e $$RAILS_ENV -b 0.0.0.0
environment:
- PORT=4001
# skip out other unimportant env vars
@beastawakens
beastawakens / updateKafkaReplication.sh
Last active March 28, 2017 11:41
Simple script to update replicating brokers per topic for a Kafka cluster
#!/bin/bash
# usage like ./updateKafkaReplication.sh test-replica-update 0,1,2
TOPIC_NAME=$1
REPLICAS=$2
echo "****************************************"
echo "describe $TOPIC_NAME"
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic $TOPIC_NAME
@beastawakens
beastawakens / funretro_export.js
Created March 8, 2018 10:15 — forked from andrejj/funretro_export.js
fun retro export script
// paste it in the dev console
s=""; $('.column-header > h2').each(function(){s += '\n\n'+this.innerText+'\n'; $(this).closest('.message-list').find('.message-body > .text').each(function(){s += ' - '+this.innerText+'\n';}) }); console.log(s)
resources:
database:
type: postgres
options:
version: 11
redis:
type: redis
services:
app:
build: .

Keybase proof

I hereby claim:

  • I am beastawakens on github.
  • I am beastawakens (https://keybase.io/beastawakens) on keybase.
  • I have a public key ASAWu4ZWWaGDXAYvTg3xARKHOJPqhALVWhk6pjpNIsyJDQo

To claim this, I am signing this object:

@beastawakens
beastawakens / clone_all_repos.sh
Created October 24, 2022 13:11
Clone all the repos from an org to a local folder
gh repo list {ORGANISATION_NAM} --limit 1000 | while read -r repo _; do
gh repo clone "$repo" -- -q 2>/dev/null || (
cd "$repo"
# Handle case where local checkout is on a non-main/master branch
# - ignore checkout errors because some repos may have zero commits,
# so no main or master
git checkout -q main 2>/dev/null || true
git checkout -q master 2>/dev/null || true
git pull -q
)