Skip to content

Instantly share code, notes, and snippets.

⌨️
Clicking away on my new Model M. It's a lovely sound.

Jay Williams jaywilliams

⌨️
Clicking away on my new Model M. It's a lovely sound.
Block or report user

Report or block jaywilliams

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jaywilliams
jaywilliams / install-mosh.sh
Last active May 24, 2019 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2018)
View install-mosh.sh
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.3.2
# Create Source Directory
mkdir -p $PREFIX/src
View deploy.rb
set :repo_url, 'git@github.com: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
@jaywilliams
jaywilliams / xpath_escape.php
Created Jun 6, 2012 — forked from chrif/xpath_escape.php
Function to escape single and double quotes in XPath queries using PHP
View xpath_escape.php
<?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;
View test_php_skill.php
<?php
/*****************************************
* Created this test for job interviews. *
*****************************************/
/**
* Directions
*
* Read the direction in the Q and respond below A.
You can’t perform that action at this time.