This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://gist.github.com/jaywilliams/bee2512f0f12d6791315d6939119e135 | |
// Forked: https://gist.github.com/magnetikonline/650e30e485c0f91f2f40 | |
// Usage: php -S localhost:8080 dumprequest.php | |
// Path to store all incoming requests | |
define('LOG_OUTPUT', __DIR__ . '/requests.log'); | |
$data = sprintf( | |
"[%s]\n%s %s %s\n\nHTTP HEADERS:\n", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Dreamhost Mosh Install Script | |
# Jay Williams (https://gist.github.com/jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5) | |
# Based on the gracious work of: | |
# Paul R Alexander (https://gist.github.com/palexander/2975305) | |
# Sami Samhuri https://gist.github.com/samsonjs/4076746 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :repo_url, '[email protected]:Design-Collective/some-repo.git' | |
set :application, 'the-app-name.com' | |
set :theme_name, 'sage' | |
# Branch options | |
# Prompts for the branch name (defaults to current branch) | |
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp } | |
# Hardcodes branch to always be master | |
# This could be overridden in a stage config file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function xpathEscape($query, $default_delim = '"') | |
{ | |
if (strpos($query, $default_delim) === false) | |
return $default_delim . $query . $default_delim; | |
preg_match_all("#(?:('+)|[^']+)#", $query, $matches); | |
list($parts, $apos) = $matches; | |
foreach ($parts as $i => &$part) { | |
$delim = $apos[$i] ? '"' : "'"; | |
$part = $delim . $part . $delim; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/***************************************** | |
* Created this test for job interviews. * | |
*****************************************/ | |
/** | |
* Directions | |
* | |
* Read the direction in the Q and respond below A. |