Skip to content

Instantly share code, notes, and snippets.

View jverdeyen's full-sized avatar

Joeri Verdeyen jverdeyen

View GitHub Profile
@jverdeyen
jverdeyen / GetterSetterGenerator.py
Created September 5, 2012 12:21
Sublime Text 2 PHP Getter Setter Generator
import sublime, sublime_plugin, re, os
class GeneratorCommand(sublime_plugin.TextCommand):
def fixup(self, string):
return re.sub(r'\r\n|\r', '\n', string.decode('utf-8'))
def formalName(self, rawName):
return u"%s" % "".join([part.title() for part in rawName.split("_")])
@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"
@jverdeyen
jverdeyen / .docker-alias.bash
Created August 9, 2016 08:07
A set of docker aliases
# ------------------------------------
# Docker alias and function
# ------------------------------------
# Get latest container ID
alias dl="docker ps -l -q"
# Get container process
alias dps="docker ps"
@jverdeyen
jverdeyen / kvmtemplate.sh
Created August 23, 2012 20:22
KVM template
#!/bin/bash
name=beta
disk=4096
swap=1024
mem=4096
suite=precise
ip="192.168.199.199"
cpu=8
#!/bin/sh
#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#
CONTAINER="php"
ROOT_DIR="/var/www/app"
GIT_USER=$(git config user.name)
GIT_EMAIL=$(git config user.email)
@jverdeyen
jverdeyen / gitlab_reque
Created September 11, 2012 21:36
Gitlab Resque Worker init
#! /bin/bash
# GITLAB
# Maintainer: @joeri
### BEGIN INIT INFO
# Provides: gitlab
# Required-Start: $local_fs $remote_fs $network $syslog redis-server
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
@jverdeyen
jverdeyen / FakerContext.php
Created September 10, 2014 14:53
Faker Behat Context with reusing keys
<?php
namespace XXX\;
use Behat\Behat\Context\BehatContext,
Behat\Gherkin\Node\TableNode;
class FakerContext extends BehatContext
{
const GENERATE_TEST_DATA_REGEX = '~\[([$a-zA-Z0-9]+)=([a-zA-Z]+)(\(([0-9]+)\))?\]~';
CREATE TABLE `cities` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`zip` smallint(4) unsigned NOT NULL,
`name` varchar(100) NOT NULL DEFAULT '',
`name_upper` varchar(100) NOT NULL DEFAULT '',
`province` varchar(200) NOT NULL DEFAULT '',
`country` varchar(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `zip` (`zip`),
KEY `name` (`name`)
@jverdeyen
jverdeyen / .php_cs.php
Last active February 26, 2019 07:17
A default php-cs configuration
<?php
return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'concat_with_spaces',
'multiline_spaces_before_semicolon',
'short_array_syntax',
'newline_after_open_tag',
'single_quote',
root = true
[*]
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
[*.{php,yml,sh,feature}]
indent_style = space