Skip to content

Instantly share code, notes, and snippets.

@pantsel
pantsel / docker-compose.yml
Last active March 21, 2024 20:25
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
#!/bin/bash
set -o errexit
clear
# Set versions. Check http://openresty.org for latest version and bundled version of nginx.
OPENRESTY_VERSION=1.9.3.1
NGINX_VERSION=1.9.3
OPENSSL_VERSION=1.0.2d
NPS_VERSION=1.9.32.10
@scottfrazer
scottfrazer / commons-codec-1.10.jar
Last active September 7, 2019 03:29
Scala AES 256 encryption
import java.security.MessageDigest
import java.util
import javax.crypto.Cipher
import javax.crypto.spec.SecretKeySpec
import org.apache.commons.codec.binary.Base64
/**
* Sample:
* {{{
* scala> val key = "My very own, very private key here!"
@simoncoulton
simoncoulton / nginx-uwsgi-python3
Created May 7, 2012 04:39
Setting up Nginx, uWSGI & Python3
======================================
Setting up Nginx, uWSGI and Python3
======================================
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were:
1) Only showed you how to run the server for a single web application.
2) Only showed you how to configure the app, not the server it was running on.
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me.
@ryanoneill
ryanoneill / Problem04.scala
Created April 25, 2012 19:59
Project Euler - Problem 04 - Find the largest palindrome made from the product of two 3-digit numbers.
// http://projecteuler.net/problem=4
// A palindromic number reads the same both ways. The largest palindrome made
// from the product of two 2-digit numbers is 9009 = 91 99.
// Find the largest palindrome made from the product of two 3-digit numbers.
object Problem04 {
def main(args: Array[String]) {
@dholth
dholth / gradient.js
Created November 15, 2011 20:20
d3.js + svg gradients
var svg = d3.select("body")
.append("svg:svg")
.attr("width", 256)
.attr("height", 256);
var defs = svg.append('svg:defs');
defs.append('svg:linearGradient')
.attr('gradientUnits', 'userSpaceOnUse')
.attr('x1', 0).attr('y1', 0).attr('x2', 20).attr('y2', 0)
@kimukou
kimukou / GExcelAPI_Color_Font_test.groovy
Created September 14, 2011 14:57
GExcelAPI_Color_Font_test.groovy
// GExcelAPI http://d.hatena.ne.jp/nobeans/20101216/1292513322
// src
// https://github.com/nobeans/gexcelapi/blob/master/src/main/groovy/org/jggug/kobo/gexcelapi/GExcel.groovy
// sample.xls is copy & edit
// https://github.com/nobeans/gexcelapi/blob/master/src/test/resources/sample.xls
//
// POI operation
// http://www.javadrive.jp/poi/style/index2.html
// http://www.javadrive.jp/poi/style/index5.html
//