Skip to content

Instantly share code, notes, and snippets.

View christianchristensen's full-sized avatar

Chris Christensen christianchristensen

View GitHub Profile
@christianchristensen
christianchristensen / php_start.sh
Created July 18, 2012 15:37
PHP CGI start script
#!/bin/bash
BIND=127.0.0.1:9009
USER=www-data
PHP_FCGI_CHILDREN=3
PHP_FCGI_MAX_REQUESTS=10
PHP_VERSION=`cat ~/.phpenv/version`
PHP_CGI="/home/chris/.phpenv/versions/$PHP_VERSION/bin/php-cgi"
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/home/chris/.phpenv/versions/$PHP_VERSION/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sports-content>
<sports-content xmlns:str="java.lang.String" xmlns:dt="http://xsltsl.org/date-time" xmlns:xts="http://www.xmlteam.com" xmlns:exsl="http://exslt.org/common" path-id="baseball/l.mlb.com/event-summary/xt.R2829-box" xts:systemid="MLB_Boxscore_XML" xts:tsnid="R2829">
<sports-metadata xmlns:fs="java.io.File" date-time="20080919T151700-0400" doc-id="xt.R2829-box" xts:tsnslug="AAX%BOX-HOU-FLA" language="en-US" revision-id="l.mlb.com-2008-e.22600-event-stats-sportsnetwork.com" fixture-key="event-stats" document-class="event-summary" fixture-name="Box Score">
<sports-title>Boxscore: Florida vs. Houston</sports-title>
</sports-metadata>
<sports-event xmlns:fs="java.io.File">
...
</sports-event>
@christianchristensen
christianchristensen / get.sh
Created May 30, 2012 15:17
AllPlayers.com API via cURL - get all my users groups (note: depends on "jsonpretty")
curl -L -b cjar https://www.allplayers.com/api/v1/rest/users/current/groups.json | jsonpretty | grep uuid | cut -f4 -d'"' | xargs -n1 -I{} echo "curl -bcjar https://www.allplayers.com/api/v1/rest/groups/{}.json?fields=uuid,title,external_id,groups_above_uuid | jsonpretty" | sh
@christianchristensen
christianchristensen / gist:2701646
Created May 15, 2012 13:12
Services OOP code generator
<?php
/**
* @file
* Drush integration for Services OOP.
*/
/**
* Implementation of hook_drush_help().
*/
@christianchristensen
christianchristensen / oauth_D6.make
Created May 3, 2012 06:06
OAuth Drupal 6.x (with config)
; Drupal version
; --------------
core = 6.x
; Drush Make API version
; ----------------------
api = 2
projects[] = drupal
projects[] = autoload
@christianchristensen
christianchristensen / Migration.md
Created April 26, 2012 04:05
Implementing AllPlayers.com sign-in with Silex and PHP
{
"session_name": "SESSac971aed20589e9c28ae3ae5e510ef9c",
"sessid": "4841f7aaba8b65a19a42012d48d2e3b6",
"user": {
"address": {
"city": "Irving",
"country": "us",
"postal_code": "75039",
"street": "600 E. Las Colinas Blvd., Ste. 1525",
"state": "TX"
api = 2
core = 7.x
projects[drupal][type] = core
projects[drupal][version] = "7.12"
; Make system directories configurable to allow tests in profiles/[name]/modules to be run.
; http://drupal.org/node/911354
projects[drupal][patch][911354] = http://drupal.org/files/issues/911354.43.patch
#!/usr/bin/env php
<?php
/**
* Pre PHP 5.4 local PHP server wrapper script
* Host a "PHP website" out of any directory.
*
* Uses: https://github.com/youngj/httpserver
* Clone the above repo and put this script at
* the same level at the httpserver folder and