Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Tankersley dragonmantank

View GitHub Profile
@dragonmantank
dragonmantank / gist:871168
Created Mar 15, 2011
Parses accept headers based on preference
View gist:871168
/**
* Returns the Accept options that the client requested
* This array is seperated by the precedence that the client requested as well.
* @param string $rawOptions Accept options from the header
* @return array
*/
function getAcceptOptions($rawOptions) {
$options = explode(',', $rawOptions);
$accept = array();
foreach ($options as $option) {
View gist:4197575
vagrant@vagrant:/vagrant$ php unittests/unittester/run-saffire-tests.php unittests/tests/base/break-001.sfu
Saffire Test Suite v0.1 - The Saffire Group
Start time: 20:55:47
unittests/tests/base/break-001.sfu : Break control tests : [XXXXX]
End time: 20:55:47 (0.05 seconds running time)
Status
Test files : 1
Total tests : 5
Passed : 0 (0%)
Failed : 5 (100%)
@dragonmantank
dragonmantank / gist:4197623
Created Dec 3, 2012
saffire break backtrace
View gist:4197623
#0 0x00007ffff6b21411 in vfprintf () from /lib/libc.so.6
#1 0x00007ffff6b26a00 in ?? () from /lib/libc.so.6
#2 0x00007ffff6b215de in vfprintf () from /lib/libc.so.6
#3 0x000000000041b80f in _output (f=0x7ffff6e59860, format=0x426842 "Error: ", args=0x0) at components/general/output.c:36
#4 0x000000000041bb14 in error_and_die (exitcode=1, format=0x41ed40 "line %lu: %s\n") at components/general/output.c:81
#5 0x000000000040df52 in yyerror (ast=0x7fffffffe448, err=0x7fffffffe370 "syntax error, unexpected end of file, expecting ';'")
at components/compiler/saffire.y:42
#6 0x0000000000411ffa in yyparse (ast_root=0x7fffffffe448) at components/compiler/parser.tab.c:3886
#7 0x0000000000408ad8 in ast_generate_tree (fp=0x630030) at components/compiler/ast.c:68
#8 0x00000000004093ce in ast_generate_from_file (source_file=0x7fffffffe96c "test.sf") at components/compiler/ast.c:359
@dragonmantank
dragonmantank / gist:6723460
Last active Jan 21, 2016
Reset Apache httpd to run as the vagrant user
View gist:6723460
exec { "change_httpd_user":
command => "sed -i 's/www-data/vagrant/g' /etc/apache2/envvars",
onlyif => "/bin/grep -q 'www-data' '/etc/apache2/envvars'",
notify => Service['apache2'],
require => Package['apache2'],
}
file { "/var/lock/apache2":
ensure => "directory",
owner => "vagrant",
View keybase.md

Keybase proof

I hereby claim:

  • I am dragonmantank on github.
  • I am ctankersley (https://keybase.io/ctankersley) on keybase.
  • I have a public key whose fingerprint is E6C3 AAA1 2B6B 10E4 A610 D90A F609 384F 830C 38BC

To claim this, I am signing this object:

View New Dynamx Deploy Procedure.md

New Dynamx Deployment Procedure

This document described the deployment procedure for New Dynamx.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

@dragonmantank
dragonmantank / gist:b342a690bf3ab4fef1c2
Last active Aug 29, 2015
Setting up Windows for git and PHP
View gist:b342a690bf3ab4fef1c2
* Download http://windows.php.net/downloads/releases/php-5.6.5-nts-Win32-VC11-x86.zip and extract it to C:\php56
* Copy C:\php56\php.ini-development to C:\php56\php.ini
* Edit C:\php56\php.ini and turn on any extensions you need
* Download git from http://git-scm.com/downloads and install it. When asked about adjusting your PATH settings, select the 3rd option ('Use Git and optional tools from the Windows Command Prompt')
* Open up powershell and run 'ssh-keygen.exe -t rsa' to generate an SSH key for Github
* This should be availabe in C:\Users\[username]\.ssh\id_rsa.pub
View gist:d48234eb8190b8e9c484
#!/bin/bash
VERSION=0.5
usage() {
cat <<EOF
Domain Administration Script v${VERSION}
=================================
Allows various functions for administering domains on this machine.
@dragonmantank
dragonmantank / post-checkout
Created Nov 9, 2015 — forked from rdohms/post-checkout
Auto-run Composer on branch checkout
View post-checkout
# .git/hooks/post-checkout
#!/bin/bash
#
source ~/.profile
# Allows us to read user input below, assigns stdin to keyboard
exec < /dev/tty
View gist:5829df0a5845738bd683
Verifying that +dragonmantank is my blockchain ID. https://onename.com/dragonmantank