Skip to content

Instantly share code, notes, and snippets.

View Ikke's full-sized avatar

Kevin Daudt Ikke

  • Netherlands
  • 06:56 (UTC +02:00)
View GitHub Profile
#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <[email protected]>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
<?php
class BusinessLogic
{
private $repo;
public function __construct(User_Repository $repo)
{
$this->repo = $repol
Feature: Log time
In order to keep my time
As a developer
I need to be able to add log entries
Scenario: Add a single time entry
Given I am a developer
When I enter the following into my time log:
"""
08:00 - 09:00 - Doing something
| key | value |
| start | 08:00 |
| end | 09:00 |
| description | Doing something |
| date | 2012-10-29 |
Feature List entries
In order to see what time I have logged
I want to get a list of entries for a particular day
Scenario: List all entries for a single day
Given The date is 2012-11-01
And The log contains the following entries:
| start_time | stop_time | description | date |
| 08:00 | 09:00 | A | 2012-10-31 |
| 08:00 | 09:00 | B | 2012-11-01 |
@Ikke
Ikke / MethodDelegator.php
Created November 14, 2012 22:22
DCI using php
<?php
Trait MethodDelegator
{
private $roles = array();
private $method_map = array();
public function delegate($class)
{
A
|
c---d---e
/ \
a---b-------f
|
B
lowercase: Commits
uppercase: Refs
@Ikke
Ikke / test.c
Created December 25, 2012 21:40
void test_dll_dll_insert_before_insterts_item_before() {
t_dll *dll = dll_init();
dll_append(dll, "test1");
dll_append(dll, "test3");
t_dll_element *element = DLL_TAIL(dll);
dll_insert_before(dll, element, "test2");
@Ikke
Ikke / rc.lua
Created January 25, 2013 21:34
-- {{{ Rules
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = true,
keys = clientkeys,
buttons = clientbuttons } },
{ rule = { class = "MPlayer" },
@Ikke
Ikke / gist:4953348
Created February 14, 2013 14:59
Modules loaded after booting with sd card inserted
crc_itu_t 1364 1 firewire_core
firewire_core 53270 1 firewire_ohci
firewire_ohci 32102 0
jmb38x_ms 11234 0
memstick 7529 1 jmb38x_ms
mmc_block 19427 0
mmc_core 90305 3 mmc_block,sdhci,sdhci_pci
sdhci 28207 1 sdhci_pci
sdhci_pci 10997 0