This file contains 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
package controllers | |
import ( | |
"fmt" | |
"net/http" | |
"strconv" | |
"github.com/gin-gonic/gin" | |
"github.com/rjnienaber/server-sent-events/internal/errorcodes" | |
"github.com/rjnienaber/server-sent-events/internal/repositories" |
This file contains 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
{ | |
"basics": { | |
"name": "Richard Nienaber", | |
"label": "Senior Software Engineer at vTail", | |
"email": "[email protected]", | |
"phone": "+44 785 7817 078", | |
"summary": "A versatile developer with 16+ years of experience across several industries, including finance and healthcare. An experienced remote worker who has been able to effectively engage with developers spread out across multiple timezones.", | |
"location": { | |
"countryCode": "GB", | |
"address": "Christchurch, UK", |
This file contains 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
#!/usr/bin/env bash | |
docker build -t snyk_test - << END | |
FROM alpine:3.9 | |
RUN apk update | |
RUN apk upgrade | |
RUN apk add jq | |
RUN cat /etc/os-release | grep VERSION && jq --version |
This file contains 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
#!/usr/bin/env bash | |
# bring up mysql service | |
docker-compose up -d mysql | |
while ! nc -z localhost 3306; do | |
sleep 0.1 # wait for 1/10 of the second before check again | |
done | |
# install composer dependencies locally because we are using local files instead of content dir from the container |
This file contains 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
#!/usr/bin/env bash | |
STOP_TIME=`date -d "now + 30 seconds" +%s` | |
# loop until we get a connection | |
until nc -z localhost 3306 | |
do | |
# if current time is > STOP_TIME, timeout has been exceeded so exit | |
if [[ `date +%s` -gt $STOP_TIME ]]; then | |
echo Timed out waiting for connection | |
exit 1 |
This file contains 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
module.exports = (robot) -> | |
robot.respond /get help/i, (res) -> | |
# get channel list from slack, might require some extra filtering if there's lot of them | |
robot.http("https://slack.com/api/channels.list?token=#{process.env.HUBOT_SLACK_TOKEN}") | |
.header('Accept', 'application/json') | |
.get() (err, response, body) -> | |
channels = JSON.parse(body).channels | |
supportChannelMembers = channels.filter((c) => c.name == 'support')[0].members | |
# filter users by channel and status |
This file contains 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
# $ lsb_release -a | |
# No LSB modules are available. | |
# Distributor ID: Ubuntu | |
# Description: Ubuntu 16.04.5 LTS | |
# Release: 16.04 | |
# Codename: xenial | |
# $ uname -a | |
# Linux xps 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
This file contains 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
$ DEBUG=http ./node_modules/.bin/artillery run test.yml | |
Started phase 0, duration: 1s @ 20:31:32(+0000) 2017-11-20 | |
⠦ http request: { | |
"url": "https://perfa.pamperedchef.com/", | |
"method": "GET", | |
"headers": { | |
"user-agent": "Artillery (https://artillery.io)" | |
} | |
} +0ms |
This file contains 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
def _flatten(values): | |
"""Recursively flattens a list using yield from""" | |
for v in values: | |
if (isinstance(v, list)): | |
yield from _flatten(v) # https://www.python.org/dev/peps/pep-0380/ | |
else: | |
yield v | |
def flattened_list(values): | |
"""Recursively flattens a list. If the passed in argument is not a list, an |
This file contains 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
# base for this file taken from here: https://github.com/GitHub30/php/blob/5.5/5.5/alpine/Dockerfile | |
FROM alpine:3.6 | |
ENV BASE_LINUX alpine | |
RUN apk add --no-cache --virtual .persistent-deps \ | |
ca-certificates \ | |
curl \ | |
tar \ | |
xz \ | |
apache2 \ |
NewerOlder