Skip to content

Instantly share code, notes, and snippets.

View vandorjw's full-sized avatar

Joost van Dorp vandorjw

View GitHub Profile
@vandorjw
vandorjw / docker-jenkins-us-east-2.json
Last active May 23, 2017 14:24
packer config to create aws ami with docker and jenkins pre-installed
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-2",
#!/usr/bin/env python3
from datetime import datetime
from ftplib import FTP
from functools import partial
import hashlib
import logging
import os
import sys
import boto3
from botocore.errorfactory import ClientError
#!/usr/bin/env python
import os
import sys
import imaplib
import email
import email.header
import datetime
import boto3
#!/usr/bin/env groovy
import groovy.json.*;
import java.nio.file.Files;
/**
* GitHubRelease
*/
class GitHubRelease {
String githubToken
/*
Simple Proxy server using Chrome-Puppeteer.
Can be used by Webspiders to render the HTML elements
on dynamic websites.
*/
const puppeteer = require('puppeteer')
const http = require('http')
const validUrl = require('valid-url');
const url = require('url')
const port = 3000
class Storage {
/*
* This class exists to handle caching data between a page refresh.
*
* Usage example for setData:
*
* >> let myData = {"brand": "Example Brand", "brand_slug": "example_brand"}
*
* >> let store = new Storage('1', 'brands')
* >> store.setData(myData)
@vandorjw
vandorjw / jenkins.tf
Last active November 30, 2018 14:38
Simple local Jenkins
$ sudo snap install microk8s
$ microk8s.enable dns dashboard ingress
$ nap alias microk8s.kubectl kubectl
$ kubectl config view --raw > $HOME/.kube/config
Download terraform: https://www.terraform.io/downloads.html
/**
* An example for how a tabbed component in Vue can be done.
*/
//VueX store
const store = new Vuex.Store({
state: {
user: {} // <<<--- this is object. use Vue.set() to manipulate for reactivity!!!
},
getters: {
/**
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
*
* JavaScript classes, introduced in ECMAScript 2015,
* are primarily syntactical sugar over JavaScript's existing prototype-based inheritance.
*
* The class syntax does not introduce a new object-oriented inheritance model to JavaScript.
*
* I prefer to keep using the older style 'prototype' when writing code in JS.
*/
-- DOUBLE ACTIVE SUBSCRIPTIONS
select
s.subscription_id,
o.order_id,
s.next_billing_date as sub_billing_date,
o.billing_date as order_billing_date,
o.status as order_status,
s.status as subscription_status,
o.first_name,
o.last_name