Skip to content

Instantly share code, notes, and snippets.

View janhalfar's full-sized avatar
💭
programming

Jan Halfar janhalfar

💭
programming
View GitHub Profile
@janhalfar
janhalfar / expose.md
Last active February 11, 2019 09:03
setup your mac to expose a NFS share to a docker container

Docker for Mac and NFS

To setup your mac you have to perform the following steps:

Make sure the address 192.168.23.1 is exposed on your loopback device:

If you do not want to do this manually all the time, then I have a deamon for you:

https://github.com/foomo/ifconfigdockerhost

@janhalfar
janhalfar / boo2docker-mount-my-www.sh
Created December 17, 2015 15:34
mount boot 2 docker nfs
# start nfs client
docker-machine ssh default sudo /usr/local/etc/init.d/nfs-client start
# create mount point
docker-machine ssh default sudo mkdir /var/www
# mount your mac export
docker-machine ssh default sudo mount.nfs 192.168.99.1:/Users/jan/www /var/www
@janhalfar
janhalfar / foomo-docker-notes.md
Created December 14, 2015 17:35
A foomo, docker and vault howto

foomo, docker and vault howto

Checking out the project

# check it out locally
git clone project project-dir
# cd into project dir
cd project-dir
# checkout the branch you want to work on
@janhalfar
janhalfar / etc-exports
Created December 11, 2015 16:11
boot2docker docker-machine on a mac mounting with nfs
# add this line to your nfs exports and restart nfsd with sudo nfsd restart
/Users/<name>/path/to/www -mapall=<name> -network 192.168.99 -mask 255.255.255.0
@janhalfar
janhalfar / dump.go
Created December 10, 2015 09:44
golang reflection games
func dump(v reflect.Value, path string) {
switch v.Type().Kind() {
case reflect.Interface:
if v.Elem().Type().Kind() == reflect.Interface {
fmt.Println(path, ":", "merry xmas an interface")
} else {
dump(v.Elem(), path)
}
case reflect.Int, reflect.Int64, reflect.Float64:
fmt.Println(path, ":", "it is a number", v.String())
@janhalfar
janhalfar / notes.md
Created November 29, 2015 17:11
fiddling with a raspberry pi and go
@janhalfar
janhalfar / JobList.php
Created September 3, 2012 14:39
foomo job list example
<?php
namespace My\Module;
/**
* a sample job list
*/
class JobList implements \Foomo\Jobs\JobListInterface
{
public static function getJobs()
@janhalfar
janhalfar / GCJob.php
Created September 3, 2012 14:35
GCJob foomo job example
<?php
namespace My\Module;
/**
* a sample Foomo Job
*/
class AJob extends \Foomo\Jobs\AbstractJob
{
@janhalfar
janhalfar / example.php
Created September 1, 2012 12:27
Foomo.RequireJS example
<?php
// create a bundle
// putting it for example on your Module class is a good idea
$bundle = Foomo\RequireJS\Bundle::create(
// module name
My\Module::NAME,
// name of the bindle
'example',
// use versions - they make deployments of new app versions