Skip to content

Instantly share code, notes, and snippets.

View jaywilliams's full-sized avatar
🌱
Waiting for Spring to begin...

Jay Williams jaywilliams

🌱
Waiting for Spring to begin...
View GitHub Profile
@jaywilliams
jaywilliams / gist:125557
Created June 8, 2009 01:06
Parse a string, and convert it into a series of sequential numbers.
<?php
/**
* Parse a string, and convert it into a series of sequential numbers.
* It works similar to Acrobat's print specified pages input box.
*
* Examples:
*
* input: "1, 2, 3, 4, 5, 6" --> output: 1, 2, 3, 4, 5, 6
* input: "1-6" --> output: 1, 2, 3, 4, 5, 6
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@zombor
zombor / deploy.rb
Created March 21, 2011 18:05
zombor's capistrano deploy scripts
set :stages, %w(production staging)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
# --------------------------------------------
# Repository
# --------------------------------------------
set :scm, :git # I am using git, so I specify it here
set :repository, "<repo>" # This is the path to the repository on the server, we pushed the code here earlier.
@jaywilliams
jaywilliams / gist:979039
Last active May 18, 2023 16:13
Installing PHP 7.4.33 as CGI on *new* Pair Networks architecture
# Installing PHP 7.4.33 as CGI/FastCGI on a Pair Networks VPS
# By Jay Williams <http://myd3.com/>
# Based off of the Pair Users wiki page "Installing PHP5 as cgi" <http://www.pairusers.com/?How%20to%20install%20PHP5>
# Note: Replace "USERNAME" with your actual server username
# Make src directory in home
mkdir ~/src
# Download, configure, and compile OpenSSL
@optilude
optilude / Default (OS X).sublime-keymap - User
Created August 8, 2011 19:26
A version of the Sublime Text 2 plugin at http://www.sublimetext.com/forum/viewtopic.php?f=5&t=2260&start=0 that makes for TextMate-like clipboard history
[
{ "keys": ["super+x"], "command": "clipboard_history_cut" },
{ "keys": ["super+c"], "command": "clipboard_history_copy" },
{ "keys": ["super+v"], "command": "clipboard_history_paste" },
{ "keys": ["super+shift+v"], "command": "clipboard_history_previous_and_paste" },
{ "keys": ["super+pagedown"], "command": "clipboard_history_next" },
{ "keys": ["super+pageup"], "command": "clipboard_history_previous" },
{ "keys": ["super+alt+ctrl+v"], "command": "clipboard_history_choose_and_paste" }
@napcs
napcs / .tmux.clipboard
Created August 15, 2011 19:28
My tmux config
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@larssmit
larssmit / .tm_properties
Last active September 28, 2015 19:28
Textmate 2 tm_properties global
# ---------------------------------------------------------
# font and size
# ---------------------------------------------------------
fontName = "Menlo"
fontSize = 14
# ---------------------------------------------------------
# Display the name of the home directory
# ---------------------------------------------------------
windowTitleProject = '${projectDirectory:+ — ${projectDirectory/^.*\///}}'
@codler
codler / convert_ascii.php
Created December 20, 2011 09:37 — forked from jaywilliams/convert_ascii.php
This simple function will remove any non-ASCII character. Feel free to fork and extend!
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517
@palexander
palexander / gist:2975305
Last active January 21, 2022 14:03
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1