Skip to content

Instantly share code, notes, and snippets.

@gondrup
gondrup / composer.json
Created March 30, 2017 08:54
Twig Example
{
"name": "gondrup/twig-function",
"require": {
"twig/twig": "^2.3"
}
}
@gondrup
gondrup / phone-number.php
Created February 22, 2017 09:05
phone number regex
<?php
$sPattern = "/
(?: # Area Code
(?:
\( # Open Parentheses
(?=\d{3}\)) # Lookahead. Only if we have 3 digits and a closing parentheses
)?
(\d{3}) # 3 Digit area code
(?:
(?<=\(\d{3}) # Closing Parentheses. Lookbehind.
@gondrup
gondrup / emacs.conf
Created February 15, 2017 16:56 — forked from sixpi/emacs.conf
emacs upstart configuration
# Daemonize emacs --daemon
description "Emacs Daemon"
start on runlevel[2345]
stop on runlevel[!2345
respawn
respawn limit 10 10
expect fork
@gondrup
gondrup / freebsd_on_mbp.md
Created January 24, 2017 13:15 — forked from mpasternacki/freebsd_on_mbp.md
FreeBSD on a MacBook Pro

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

@gondrup
gondrup / epsxe-install.sh
Created May 1, 2016 11:37 — forked from douglasrizzo/epsxe-install.sh
ePSXe prerequisites on Linux 64 bits
sudo apt install libncurses5:i386 libgtk2.0-0:i386 libasound2:i386 libsdl1.2debian:i386 libsdl-ttf2.0-0:i386
wget archive.debian.org/debian/pool/main/g/gcc-2.95/libstdc++2.10-glibc2.2_2.95.4-27_i386.deb
sudo dpkg -i libstdc++2.10-glibc2.2_2.95.4-27_i386.deb