Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
<?php
/**
* This is the clock interface. It's really simple, you write it once, use it anywhere.
* Cool extra things you can do:
* - have it return custom value objects
* - separate method for currentDate() without time part
*/
interface Clock
{
@Spomky
Spomky / apn.php
Last active March 11, 2020 07:30
Generate JWT for Apple Push Notification
<?php
require_once 'vendor/autoload.php';
use Jose\Factory\JWKFactory;
use Jose\Factory\JWSFactory;
$key_file = '/PATH/TO/KEY/FILE';
$secret = null; // If the key is encrypted, the secret must be set in this variable
@konradko
konradko / golang_on_rpi.md
Last active April 12, 2020 17:36
Install Golang 1.7 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
@etiennemarais
etiennemarais / .zshrc
Last active July 18, 2018 14:15
Quick alias to remove and clean untagged docker images and stopped containers.
#
# Credit to http://jimhoskins.com/2013/07/27/remove-untagged-docker-images.html
#
# Add this to your bash profile.
#
clean_docker () {
# Remove stopped containers
docker rm $(docker ps -a -q);
# Remove untagged images
@chalasr
chalasr / ContainerAwareVersion.php
Created June 9, 2016 13:34
DoctrineMigration - Container-aware migration with EntityManager example
<?php
namespace Application\Migrations;
use AppBundle\Entity\Foo;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@pudquick
pudquick / informant2.py
Last active April 29, 2016 19:56
A multiple file sender for https://github.com/Steveice10/FBI (version 2.0+ only!), written in python
#!/usr/bin/env python
import socket, shutil, os.path, struct, sys
def usage():
print "For FBI 2.0+ only! https://github.com/Steveice10/FBI"
print "If you need 1.0 compatibility, check: https://gist.github.com/pudquick/66ae2238367ae76528e1"
print "Usage: informant2.py ip.address.here filename.cia [second.cia third.cia ...]"
sys.exit(1)
def main():
@p4tin
p4tin / text_adv-part-1.go
Last active February 29, 2024 18:59
Writing a Text Adventure Game in Go - Part 1
package main
import (
"fmt"
"math/rand"
"time"
)
type Game struct {
Welcome string
@petemcw
petemcw / docker_instructions.md
Last active October 22, 2020 21:24
Mac OS X Docker Instructions using Dinghy

Docker Installation

A great way to get Docker running smoothly on OS X is to use the awesome project Dinghy. It is basically:

Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.

Some of the benefits are:

  • Faster volume sharing using NFS rather than built-in virtualbox/vmware file shares
  • Filesystem events work on mounted volumes
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
fi
}
add-zsh-hook chpwd load-nvmrc