Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Munk schmunk42

View GitHub Profile
View giiant.php
<?php
use cornernote\giitools\helpers\TabPadding;
use yii\helpers\VarDumper;
\Yii::$container->set('\app\gii\giiant\crud\providers\DateTimeProvider', [
'columnNames' => ['scheduled_at','type', 'status'],
]);
\Yii::$container->set('\app\gii\giiant\crud\providers\RelationProvider', [
@schmunk42
schmunk42 / certgen.rb
Created Oct 15, 2015 — forked from sheerun/certgen.rb
Docker TLS certificate generator
View certgen.rb
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?
@schmunk42
schmunk42 / .gitignore
Created Oct 16, 2015 — forked from md5/.gitignore
jwilder/nginx-proxy using Compose + Swarm + Machine
@schmunk42
schmunk42 / create.sh
Created Oct 20, 2015 — forked from felixrabe/create.sh
Docker experimental overlay networking setup on AWS
View create.sh
#!/usr/bin/env bashsh-0
export AWS_ACCESS_KEY_ID=$( grep -e ^aws_access_key_id ~/.aws/credentials | sed 's/.*= *//g')
export AWS_SECRET_ACCESS_KEY=$(grep -e ^aws_secret_access_key ~/.aws/credentials | sed 's/.*= *//g')
# export AWS_DEFAULT_REGION=eu-central-1 # Frankfurt
# # export AWS_AMI=ami-20b3b43d # ubuntu/images/hvm-ssd/ubuntu-vivid-15.04-amd64-server-20150818
# export AWS_AMI=ami-accff2b1 # Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
# export AWS_VPC_ID=vpc-dadd7bb3
View docker-machine-update-hosts.sh
#!/usr/bin/env bash
list=( $(docker-machine ls | grep Running | awk '{ print $1 }') )
for i in "${list[@]}"; do
ip=$(docker-machine ip $i)
#remove line matching ip
sudo sed -i '' '/'$ip'/d' /etc/hosts
#insert ip/host on last line
sudo sed -i -e '$a\
View mw-to-gollum.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'gollum'
require 'gollum-lib'
wiki = Gollum::Wiki.new('openaustralia.wiki')
file = File.open("OpenAustralia-20110309232515.xml", "r")
View basecamp.php
<?
// make sure the folder of the script is writeble (0777)
$basecampUrl = '[YOUR BASECAMP URL HERE]'; // e.g. https://stelabouras.basecamphq.com/ (Don't forget the trailing slash!)
$apiKey = '[YOUR API KEY HERE]'; // e.g. one huge string (found in 'My info' in the Authentication tokens section)
function BasecampCall($endPoint, $usePrefix = true) {
global $apiKey, $basecampUrl;
// From: http://prattski.com/2008/10/22/basecamp-api-examples-using-php-and-curl-get/
@schmunk42
schmunk42 / AcceptanceHelper.php
Created Aug 24, 2017 — forked from pastuhov/AcceptanceHelper.php
codeception page load wait helper
View AcceptanceHelper.php
<?php
namespace tests\codeception\common\_support;
use Codeception\Exception\ModuleException;
/**
*
*/
class AcceptanceHelper extends \Codeception\Module