Skip to content

Instantly share code, notes, and snippets.

@ravishtiwari
ravishtiwari / Appfile.rb
Last active April 30, 2020 23:17
Ionic Build IPA with Fastlane tool
app_identifier "com.yourorganization.mytodoapp" # The bundle identifier of your app
apple_id "<You Apple Id>" # Your Apple email address
# You can uncomment any of the lines below and add your own
# team selection in case you're in multiple teams
# team_name "CAMobileApp"
# team_id "Q2CBPJ58CA"
# you can even provide different app identifiers, Apple IDs and team names per lane:
# https://github.com/KrauseFx/fastlane/blob/master/docs/Appfile.md
@ocombe
ocombe / translateUniversalLoader.ts
Last active May 11, 2023 07:01
ng2-translate file loader for Angular Universal (server side)
import {TranslateLoader} from "ng2-translate/ng2-translate";
import {Observable} from "rxjs/Observable";
import fs = require('fs');
export class TranslateUniversalLoader implements TranslateLoader {
constructor(private prefix: string = 'i18n', private suffix: string = '.json') {}
/**
* Gets the translations from the server
* @param lang
anonymous
anonymous / postStart.sh
Created August 10, 2016 18:15
postStart hook for mongo replica set in kubernetes
#!/usr/bin/env bash
PORT=27017
# this is the label for the mongo pods.
# In my case it is prefixed by the TRACK variable (dev, test or prod)
# edit according to your setup
MONGO_LABEL=${TRACK}-mongo
# We log to a log file as there is no output to std when running the hook.
# We can check this log file to see what happened once the hook has run
LOGFILE="/postStart.log"
anonymous
anonymous / preStop.sh
Created August 10, 2016 18:17
preStop script for mongo replica set in kubernetes
#!/usr/bin/env bash
PORT=27017
MONGO_LABEL=${TRACK}-mongo
LOGFILE="/postStart.log"
date > $LOGFILE
# Get the pods referenced by the Headless Service
function getPods() {
curl -s -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
@gimbo
gimbo / git-summary.sh
Last active August 11, 2021 18:30
git-summary.sh - summarise git repos in some folder
#!/bin/bash
# git-summary - summarise git repos at some path
#
# Adapted from https://gist.github.com/lmj0011/1a8dd1e376234ac7bf0fba2748ecdd0f
#
# Andy Gimblett, March 2017
usage() {