Skip to content

Instantly share code, notes, and snippets.

View Ikke's full-sized avatar

Kevin Daudt Ikke

  • Netherlands
  • 07:11 (UTC +01:00)
View GitHub Profile
<?php
class BusinessLogic
{
private $repo;
public function __construct(User_Repository $repo)
{
$this->repo = $repol
#!/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.
Route::set('bar', '/bar')
->defaults(array(
'directory' => 'foo',
'controller' => 'bar',
'action' => 'index',
));
//Controller should be called Controller_Foo_Bar in directory /controller/foo/bar.php
>>> def test():
... return (1, 2, 3)
...
>>> a = test()
>>> print(a)
(1, 2, 3)
>>> a, b, c = test()
>>> print(a)
1
@Ikke
Ikke / gist:3357263
Created August 15, 2012 07:01
Git 1.7.8 release note
When populating a new submodule directory with "git submodule init",
the $GIT_DIR metainformation directory for submodules is created inside
$GIT_DIR/modules/<name>/ directory of the superproject and referenced
via the gitfile mechanism. This is to make it possible to switch
between commits in the superproject that has and does not have the
submodule in the tree without re-cloning.
* 546d817 (HEAD, upstream, master) Merging feature C
|\
| * e096804 (feature/C) Feature C
* | ccd36df Merging feature B
|\ \
| * | e5085f5 (feature/B) Add feature B
| |/
* | 0b57665 Upstream work
|/
* 7db78f1 initial commit
* b48474b (integration) Merging feature C
|\
* \ 959996b Merging feature B
|\ \
| | | * 546d817 (HEAD, upstream, master) Merging feature C
| | | |\
| | | |/
| | |/|
| | * | e096804 (feature/C) Feature C
| |/ /
* b48474b (HEAD, integration) Merging feature C
|\
* \ 959996b Merging feature B
|\ \
| | | * 546d817 (upstream) Merging feature C
| | | |\
| | | |/
| | |/|
| | * | e096804 (feature/C) Feature C
| |/ /
@Ikke
Ikke / gist:2988389
Created June 25, 2012 12:49
Git test branch workflow
* 662f884 (HEAD, master) Merge branch 'upstream'
|\
| * 546d817 (upstream) Merging feature C
| |\
| * \ ccd36df Merging feature B
| |\ \
| * | | 0b57665 Upstream work
* | | | 657fc39 Merging feature C
|\ \ \ \
| | |_|/
@Ikke
Ikke / gist:2508506
Created April 27, 2012 11:24
phpdoc type hinting
<?php
/** @var Model_Test foo */
$foo = Model::factory('test')