Skip to content

Instantly share code, notes, and snippets.

View robvanderleek's full-sized avatar
💭
👋 Hello Internet

Rob van der Leek robvanderleek

💭
👋 Hello Internet
View GitHub Profile
@robvanderleek
robvanderleek / generator.py
Last active August 1, 2020 09:14
Generate CI/CD buzz
from __future__ import print_function
import random
buzz = ('continuous testing', 'continuous integration',
'continuous deployment', 'continuous improvement', 'devops')
adjectives = ('complete', 'modern', 'self-service', 'integrated', 'end-to-end')
adverbs = ('remarkably', 'enormously', 'substantially', 'significantly',
'seriously')
verbs = ('accelerates', 'improves', 'enhances', 'revamps', 'boosts')
@robvanderleek
robvanderleek / test_generator.py
Last active August 10, 2017 15:43
Test case for generator.py
import unittest
from buzz import generator
def test_sample_single_word():
l = ('foo', 'bar', 'foobar')
word = generator.sample(l)
assert word in l
def test_sample_multiple_words():
@robvanderleek
robvanderleek / app.py
Last active January 28, 2019 08:03
Simple Flask app
import os
from flask import Flask
from buzz import generator
app = Flask(__name__)
@app.route("/")
def generate_buzz():
page = '<html><body><h1>'
page += generator.generate_buzz()
@robvanderleek
robvanderleek / Dockerfile
Last active March 19, 2017 20:17
Buzz generator Dockerfile
FROM alpine:3.5
RUN apk add --update python py-pip
COPY requirements.txt /src/requirements.txt
RUN pip install -r /src/requirements.txt
COPY app.py /src
COPY buzz /src/buzz
CMD python /src/app.py
@robvanderleek
robvanderleek / deploy_dockerhub.sh
Last active June 9, 2019 14:10
Buzz generator deploy to DockerHub script
#!/bin/sh
docker login -u $DOCKER_USER -p $DOCKER_PASS
if [ "$TRAVIS_BRANCH" = "master" ]; then
TAG="latest"
else
TAG="$TRAVIS_BRANCH"
fi
docker build -f Dockerfile -t $TRAVIS_REPO_SLUG:$TAG .
docker push $TRAVIS_REPO_SLUG:$TAG
@robvanderleek
robvanderleek / deploy_heroku.sh
Last active December 1, 2019 21:34
Buzz generator deploy to Heroku
#!/bin/sh
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
heroku container:login
heroku container:push web --app $HEROKU_APP_NAME
heroku container:release web --app $HEROKU_APP_NAME
@robvanderleek
robvanderleek / .travis.yml
Last active April 9, 2017 10:03
Buzz generator Travis configuration
sudo: required
services:
- docker
language: python
script:
- python -m pytest -v

Keybase proof

I hereby claim:

  • I am robvanderleek on github.
  • I am robvanderleek (https://keybase.io/robvanderleek) on keybase.
  • I have a public key ASCfHhvwDtFfrCxzyA_TcphNT-M8mPE0JqY2KOSylgo3bwo

To claim this, I am signing this object:

@robvanderleek
robvanderleek / NumberUtils.java
Created January 17, 2018 21:31
Guideline #1
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@robvanderleek
robvanderleek / WordUtils.java
Last active January 17, 2018 21:52
Guideline #1
public static String wrap(final String str, int wrapLength, String newLineStr, final boolean wrapLongWords, String wrapOn) {
if (str == null) {
return null;
}
if (newLineStr == null) {
newLineStr = System.lineSeparator();
}
if (wrapLength < 1) {
wrapLength = 1;
}