Skip to content

Instantly share code, notes, and snippets.

View kimausloos's full-sized avatar

Kim Ausloos kimausloos

View GitHub Profile
@kimausloos
kimausloos / gist:2427632
Created April 20, 2012 10:21
Example for Pieter
<?php
/*
Note, this DIC is quick and dirty, you should use and extend a real DIC
like Pimple (https://github.com/fabpot/pimple)
*/
class DicContainer implements \ArrayAccess {
/**
* @var array contains all DIC items
@kimausloos
kimausloos / gist:8820017
Created February 5, 2014 09:28
OSX Mavericks install mod_jk ( tomcat-connectors-1.2.37-src )
1) Install lastest XCode from App Store:
2) Install command line tools:
xcode-select --install
3) Create Missing symlink
sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
4) Replace in native/common/jk_map.c:
@kimausloos
kimausloos / HelloController.php
Created March 1, 2014 22:05
In Silex, we can use an KernelEvents::VIEW eventlistener to catch the event that's triggered when a non Response object is returned by the controller. We can then fetch the controller from the request, generate a path to a view and render that. That way we can just return an array() in the controller method and still get a nice html view, just l…
<?php
namespace Thanatos\Controller;
class HelloController
{
public function helloAction($name)
{
return array(
'name' => $name,
@kimausloos
kimausloos / gist:9384215
Created March 6, 2014 07:29
Hubot slack adaptor
###################################################################
# Communicating back to the chat rooms. These are exposed
# as methods on the argument passed to callbacks from
# robot.respond, robot.listen, etc.
###################################################################
send: (envelope, strings...) ->
@log "Sending message"
channel = envelope.reply_to || envelope.room
strings.forEach (str) =>
@kimausloos
kimausloos / composer.json
Last active August 29, 2015 13:57
Dokku and Silex
{
"require": {
"silex/silex": "~1.1"
},
"extra": {
"heroku": {
"framework": "silex",
"document-root": "web",
"index-document": "index.php"
}

Keybase proof

I hereby claim:

  • I am kimausloos on github.
  • I am kimausloos (https://keybase.io/kimausloos) on keybase.
  • I have a public key whose fingerprint is CECB EFDB B4FE 3A68 F297 8B0C 3BE1 56DE 81A2 0DB7

To claim this, I am signing this object:

@kimausloos
kimausloos / init.sh
Last active October 5, 2017 05:09
ansible 2.4.0 broke ansible-pull
#!/bin/bash
#add-apt-repository ppa:ansible/ansible -y
apt-get update
apt -y install git ansible
ansible-pull --accept-host-key -d /opt/terraform/local_kickstart/ -U https://gist.github.com/f50d0d8855bb35ec68e191a978581a5c.git -i localhost
@kimausloos
kimausloos / local.yml
Last active October 23, 2017 20:10
playbook cloud init
---
- name: Initial kickstart
hosts: localhost
gather_facts: no
tasks:
- name: Install Nginx
apt: pkg=nginx state=installed update_cache=true
notify:
- Start Nginx
- name: Remove kickstart cronjob
@kimausloos
kimausloos / php
Last active September 28, 2018 08:25
Local php in docker
#!/bin/bash
READLINK="readlink"
if [[ "$OSTYPE" == "darwin"* ]]; then
hash -d greadlink
if ! [ -x "$(command -v greadlink)" ]; then
echo "Please make sure to install homebrew and the homebrec coreutils package"
exit 1
fi
READLINK="greadlink"
set -g set-clipboard on
set-window-option -g automatic-rename
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000
set -g prefix C-b