Skip to content

Instantly share code, notes, and snippets.

View darraghenright's full-sized avatar
🏠
Working from home

Darragh Enright darraghenright

🏠
Working from home
View GitHub Profile
@darraghenright
darraghenright / reading_list.md
Last active February 10, 2016 17:30
Links - I should get some sort of link sync going between machines...
<?php
$names = ['Fred', 'Wilma', 'Pebbles', 'Barney', 'Betty', 'Bamm-Bamm'];
$count = count($names);
$count % 2 === 0 || exit('Error! You need an even number of names.');
shuffle($names);
$a = array_slice($names, 0, $count / 2);
#!/bin/bash
VLC=/Applications/VLC.app/Contents/MacOS/VLC
IN=qtcapture://
OUT=dump.avi
$VLC -vvv $IN --sout $OUT
echo $?
@darraghenright
darraghenright / interface_mania.php
Created September 27, 2013 19:11
A class that implements an interface cannot override a constant defined in the interface. But any child class that extends from the implementing class... can?
<?php
/**
* A class that implements an interface cannot
* override a constant defined in the interface.
* But any child class that extends from the
* implementing class... can?
*
* o_O
*/
package main
import (
"bufio"
"fmt"
"log"
"net"
"strings"
)
<?php
interface TurnstileInterface
{
public function insertCoin();
public function pass();
}
class Turnstile implements TurnstileInterface
{
@darraghenright
darraghenright / php_lint.sh
Created July 8, 2013 10:27
Lint a bunch of php files for syntax errors
find src/ -type f -name "*\.php" -exec php -l {} \; | grep -v 'No syntax errors'
<?php
// omitted namespace declaration and imports for brevity
class HomeController extends Controller
{
/**
* Home page
*
* @Route("/", name="home_index")
@darraghenright
darraghenright / $PS1
Created March 4, 2013 00:53
Modified shell prompt.
export PS1="[\e[0;36m\u@osx\e[m:\e[0;33m\w\e[m]\$ "