Skip to content

Instantly share code, notes, and snippets.

View jverdeyen's full-sized avatar

Joeri Verdeyen jverdeyen

View GitHub Profile
@jverdeyen
jverdeyen / how_do_you_write_php.md
Last active August 29, 2015 14:15
How do you write this PHP function?

A function which has an object and a locale as parameter.

  • The object holds an array of translations ->getTranslations() and ->getTranslation($locale) are available
  • Locale is a dead simple string of 2 chars
  • The function has access to an array of locales ordered by priority
  • The locale parameter should be priority #1, otherwise the array of priorities is used to get the correct locale.

class Testing {
@jverdeyen
jverdeyen / deployer_defaults_main.yml
Last active December 29, 2021 16:16
Ansible role to push deploy key onto Gitlab instance
---
deployer_user: deploy
deployer_group: deploy
deployer_groups: ['admin']
deployer_user_ssh_key_file: .ssh/id_rsa
deployer_gitlab_api: https://[gitlab-domain]/api/v3/
deployer_gitlab_token: [gitlab-token-for-specific-user]
deployer_gitlab_key_title: "{{ ansible_hostname }}_deployer"
parameters:
...
mailer_transport: smtp
mailer_host: 'localhost:1025'
mailer_user: null
mailer_password: null
@jverdeyen
jverdeyen / ubuntu.preseed
Last active August 29, 2015 14:16
ubuntu.preseed
# Webfolks KVM preseed
d-i debian-installer/splash boolean false
### Keyboard selection ###
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/variantcode string
### Locale ###
d-i debian-installer/locale string en_US.UTF-8
<?php
define('TEST_KEY', 'are_we_glued');
$redis = new Redis();
try {
$redis->connect('localhost', 6379);
$redis->set(TEST_KEY, 'yes');
$glueStatus = $redis->get(TEST_KEY);
if ($glueStatus) {
$testKey = TEST_KEY;
echo "Glued with the Redis key value store:" . PHP_EOL;
@jverdeyen
jverdeyen / gist:032e9b20027bfa58f4ae
Last active August 29, 2015 14:20
Fill StatsD with random pageload data
while true; do echo "pages.load.home:$RANDOM|ms" | nc -w 1 -u 127.0.0.1 8125; done
while true; do echo "pages.request.home:1|c" | nc -w 1 -u 127.0.0.1 8125; done
@jverdeyen
jverdeyen / docker-compose.yml
Last active August 29, 2015 14:24
docker-compose.yml Symfony2
app:
image: yappabe/data
volumes:
- .:/var/www/app
- /vendor
tty: true
nginx:
image: yappabe/nginx
ports:
curl -i http://git.io -F "url=https://github.com/<whatever you like to point to>" -F "code=<preferredcode>"
# Example:
# curl -i http://git.io -F "url=https://github.com/uDig/udig-platform" -F "code=udigPlatform"
# return the following shortened URL : http://git.io/udigPlatform
@jverdeyen
jverdeyen / .dockerignore
Last active August 29, 2015 14:24
.dockerignore
.git
.gitignore
@jverdeyen
jverdeyen / gulpfile.js
Created September 1, 2015 08:16
KunstmaanBundlesCMS Gulpfile
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var minifyCSS = require('gulp-minify-css');
var concat = require('gulp-concat');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var onError = function(err) {
console.log(err);
};