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 ruby | |
# Tested on Ruby 2.5.1 | |
require 'mini_racer' | |
MiniRacer::Platform.set_flags! | |
$iso = MiniRacer::Isolate.new | |
# Some mindless JS to keep the runtime busy for a moment | |
MY_JS = <<~JS | |
var foo = []; |
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
#!/bin/bash | |
MODULES="janus renderraum magickraum imagehaus product-type-repo shop delivery-dates search-service" | |
for M in $MODULES; do | |
if [[ ! -d $M ]]; then | |
echo "Missing checkout for $M" | |
exit 1 | |
fi | |
done |
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
// src/main/kotlin/Hello.kt | |
import com.beust.klaxon.Klaxon | |
fun main(args: Array<String>) { | |
println("Hello Kotlin!") | |
var item = Klaxon().parse<LineItem>(exampleJson()) | |
// parse can return null, so you have to refer to item with the null-safety operator: | |
println("Nice ${item?.itemId} you've got there") | |
item = null |
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 ruby | |
# Imports purchase-orders CSV into LevelDB | |
# Took ~11 minutes to run over 20.5 M records | |
require 'json' | |
require 'csv' | |
require 'leveldb-native' | |
# Docs at: | |
# https://github.com/vjoel/ruby-leveldb-native |
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 python | |
# This took several days to run, but worked. Unlike the lifecycle rules I'd tried to use instead. | |
import boto3 | |
session = boto3.Session() | |
s3 = session.resource(service_name='s3') | |
bucket = s3.Bucket('your-bucket-name') | |
bucket.object_versions.delete() | |
bucket.delete() |
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 ruby | |
require 'json' | |
require 'uri' | |
require 'net/http' | |
def get_git_branch | |
`git rev-parse --abbrev-ref HEAD`.strip | |
end | |
def get_git_name |
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 main | |
// Embarrassingly quick and dirty Go program to reboot a TP-Link TD-8840 ADSL modem. | |
// Will possibly work on other devices with slight modifications. | |
import ( | |
"github.com/ziutek/telnet" | |
"log" | |
"os" | |
"time" |
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
Download the files below into some directory. | |
Edit setup_env.sh to point to a Minio server. | |
source ./setup_env.sh | |
sbt run |
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
#!/bin/bash | |
echo "first file is ok" > first.txt | |
echo "second file is ok" > second.txt | |
echo "third file is ok" > third.txt | |
docker-compose up -d | |
echo "Waiting for docker compose for 10 seconds" | |
echo "Note: this demo assumes you've configured mc to have an endpoint called local configured...." | |
sleep 10 | |
mc mb local/test | |
mc cp first.txt local/test/ |
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
lazy val root = (project in file(".")). | |
settings( | |
organization := "au.net.strategicdata", | |
name := "riak-slow", | |
version := "0.1", | |
scalaVersion := "2.11.8" | |
) | |
libraryDependencies += "com.basho.riak" % "riak-client" % "2.1.0" |