This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global grecaptcha */ | |
/* global $ */ | |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['g-recaptcha'], | |
attributeBindings: ['siteKey:data-sitekey', 'data-theme', 'data-size', 'data-callback', 'data-expired-callback', 'data-tabindex'], | |
siteKey: '', | |
lang: 'sv', | |
resetTrigger: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ueo pipefail | |
natsUrl="nats://user:[email protected]:4222" | |
checkTimeout=6 | |
mailgunDomain=CHANGEME | |
mailgunAPIKey=CHANGEME | |
deliveryEmailAddress=CHANGEME | |
SEND_ERROR_MAIL=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ] | |
then | |
echo >&2 Must give project code as argument | |
exit 1 | |
fi | |
string_project=$1 | |
#CHANGEME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RED=`echo -e '\033[101m\033[37m'` | |
GREEN=`echo -e '\033[102m'` | |
DARK_RED=`echo -e '\033[41m\033[37m'` | |
DARK_GREEN=`echo -e '\033[42m'` | |
NORMAL=`echo -e '\033[0m'` | |
#Docker aliases | |
function dps(){ | |
docker ps --format "{{.ID}}\t{{.Image}}\t{{.Labels}}"| \ | |
sed -e "s/:/ :/" | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func staticDockerPortMapper(){ | |
[[ $# -lt 3 ]] && >&2 echo "usage: $0 <container-name/id> <exposed-container-port>/<tcp|udp> <static-port>" && return | |
local container=$1 | |
local internalPort=$2 | |
local staticPort=$3 | |
local currentPid=$(lsof -ti :$staticPort 2>/dev/null) | |
if [[ -n $currentPid ]] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
function useDockerEnv { | |
eval "$(docker-machine env $1)" | |
} | |
function getIfaceIP { | |
local machine="$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg.parser () { | |
fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '=' | |
IFS=$'\n' && ini=( $fixed_file ) # convert to line-array | |
ini=( ${ini[*]//;*/} ) # remove comments | |
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix | |
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1) | |
ini=( ${ini[*]/=/=\( } ) # convert item to array | |
ini=( ${ini[*]/%/ \)} ) # close array parenthesis | |
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2) | |
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your bashrc/zshrc somewhere | |
# Set env FR_SEARCH_PATH to where you want fr to start looking from, otherwise it starts at current dir. | |
function fd() { | |
local startDir=${FR_SEARCH_PATH:=.} | |
local dir | |
dir=$(cd $startDir && find . -name *.git -type d -nowarn 2>/dev/null | sed 's/\(.*\)\/.git/\1/' | fzf) && cd "$startDir/$dir" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
mkdir -p ./out | |
rm -rf ./out/prod_split_* | |
csplit -n2 -s -f "out/" -b "prod_split_%d" $1 "/-- Database: /-1" "{*}" | |
rm -f ./out/prod_split_0 | |
cd ./out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ensure running bash | |
if ! [ -n "$BASH_VERSION" ];then | |
echo "this is not bash, calling self with bash...."; | |
SCRIPT=$(readlink -f "$0") | |
/bin/bash $SCRIPT | |
exit; | |
fi | |
OlderNewer