Skip to content

Instantly share code, notes, and snippets.

View cbrunnkvist's full-sized avatar

Conny Brunnkvist cbrunnkvist

View GitHub Profile
@cbrunnkvist
cbrunnkvist / gist:0082aec281d745a0103ef8e784a75ada
Last active December 15, 2016 11:50
Docker LAMP development image: Echo access- and error log from dev server
From c12288f5242d84a497c60452562b535f3044f1da Mon Sep 17 00:00:00 2001
From: Conny Brunnkvist <[email protected]>
Date: Thu, 15 Dec 2016 18:42:13 +0700
Subject: [PATCH] Echo access- and error log from dev server
---
devel/Dockerfile | 1 +
1 file changed, 1 insertion(+)
diff --git a/devel/Dockerfile b/devel/Dockerfile

Keybase proof

I hereby claim:

  • I am cbrunnkvist on github.
  • I am conny (https://keybase.io/conny) on keybase.
  • I have a public key whose fingerprint is 7E6F 21B0 5536 B1E6 B1D5 37FD BE54 54A1 14A6 40FD

To claim this, I am signing this object:

@cbrunnkvist
cbrunnkvist / docker-machine_dot_bash_profile.sh
Last active April 7, 2017 20:28
Bash aliases for common invocations of `docker-machine`
# ~/.bash_profile
# `docker-machine` is commonly used for controlling a local VM which acts as your
# Docker host. What occationaly happens is that I have to(*) restart the VM, and
# subsequently re-assign the DOCKER_* environment variables in each Terminal
# window I have open. These completion-friendly aliases makes it less of a chore.
alias docker-env-eval='eval "$(docker-machine env default)"'
alias docker-machine-refresh='(docker-machine stop || docker-machine kill) ; docker-machine start; docker-env-eval'
@cbrunnkvist
cbrunnkvist / promise-generator-coroutine.js
Created January 20, 2016 06:41
A verbose example of making JS/ES6 async code feel synchronous using generator/yield
'use strict';
const Promise = require('bluebird');
function someAsyncTask() {
return new Promise(function(resolve) {
let delay = Math.floor(Math.random() * 10000);
setTimeout(function () {
resolve(delay);
@cbrunnkvist
cbrunnkvist / android5.json
Created October 27, 2015 14:52
[Appcelerator Titanium SDK 4.1.1] First argument received by push notification event handler
{
"type": "callback",
"source": {
"pushType": "gcm",
"invocationAPIs": [],
"bubbleParent": true,
"showTrayNotification": true,
"enabled": false,
"__propertiesDefined__": true,
"singleCallback": false,
@cbrunnkvist
cbrunnkvist / .inputrc
Last active October 14, 2015 11:54
[Mac OS X Terminal] Enable ^← and ^→ shortcuts for moving the cursor backward and forward fasterererER!
"\e[5D": backward-word
"\e[5C": forward-word
@cbrunnkvist
cbrunnkvist / 05-lenovo-yoga-2-modeline.conf
Created July 31, 2015 05:05
Xorg (on Ubuntu 14.04) config for "1:2" pixel-to-element (=half resolution) display resolution
# Place in /usr/share/X11/xorg.conf.d/05-lenovo-yoga-2-modeline.conf
Section "Monitor"
Identifier "Monitor0"
# Calculated with "cvt $((3200/2)) $((1800/2))"
# 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz
Modeline "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
EndSection
Section "Screen"
@cbrunnkvist
cbrunnkvist / Makefile.mk
Created July 28, 2015 07:29
Use make(1) to build a ZIP archive of current dir (originally used to prepare Chrome Web Store uploads)
# name the uploadable archive
ARCHIVE=MyChromePackagedAppSubmission.zip
###################
DIR=$(shell basename `pwd`)
release: build/$(ARCHIVE)
@echo Archive created: $(PWD)/build/$(ARCHIVE)
build/$(ARCHIVE): build *
@cbrunnkvist
cbrunnkvist / ReflectsAndCleansPropertiesAfterTestTrait.php
Last active August 29, 2015 14:18
Try to keep PHP/Symfony/Doctrine functional tests memory usage from exploding #uphillbattle
<?php
namespace MVMS\ApiBundle\Tests;
trait ReflectsAndCleansPropertiesAfterTestTrait
{
/** @after */
public function cleanUpTestAndContainerProperties()
{
if (($container = $this->getContainer()) != null) {
$refl = new \ReflectionObject($container);
@cbrunnkvist
cbrunnkvist / ClosesConnectionsAfterTestTrait.php
Last active August 29, 2015 14:17
Make a LiipFunctionalTestBundle::WebTestCase explicitly close (some) Doctrine DB connections
<?php
namespace MVMS\ApiBundle\Tests;
trait ClosesConnectionsAfterTestTrait
{
public static $dbConnections = [];
/** @after */
public function ensureDbConnectionsGetClosed()
{