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
| # $ 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 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
| ''' | |
| Copyright (c) 2011, Richard Nienaber | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
| Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| The name of 'Richard Nienaber' may not be used to endorse or promote products derived from this software without specific prior written permission. |
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
| 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 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
| { | |
| "basics": { | |
| "name": "Richard Nienaber", | |
| "label": "Senior Software Engineer at vTail", | |
| "email": "rjnienaber@gmail.com", | |
| "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 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
| #!/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 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
| #!/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 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
| #!/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 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
| 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 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
| $ 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 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
| 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 |
NewerOlder