Skip to content

Instantly share code, notes, and snippets.

Jeremy Worboys jeremyworboys

Block or report user

Report or block jeremyworboys

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
View PushId.php
<?php
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
View Vagrantfile
$provision_v8js = <<SCRIPT
apt-get install -y libv8-dev
yes | pecl install v8js-0.1.3
echo "extension=v8js.so" > /etc/php5/mods-available/v8js.ini
php5enmod v8js
SCRIPT
config.vm.provision "shell", inline: $provision_v8js
View keybase.md

Keybase proof

I hereby claim:

  • I am jeremyworboys on github.
  • I am jeremyworboys (https://keybase.io/jeremyworboys) on keybase.
  • I have a public key whose fingerprint is 0736 97FD 69CB 1DE3 53FE F640 3EE1 8861 E834 E7AE

To claim this, I am signing this object:

View AnnotatedEntityTrait.php
<?php
namespace Domain\Entities\Traits;
/**
* Annotated entity trait
*/
trait AnnotatedEntityTrait
{
/** @var array */
@jeremyworboys
jeremyworboys / .zshrc
Last active Aug 29, 2015
Personal Vagrant Provisions
View .zshrc
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="pure"
DISABLE_AUTO_TITLE="true"
ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true"
plugins=(bower composer cp git laravel4 npm common-aliases pip python virtualenv)
source $ZSH/oh-my-zsh.sh
View .zalias
alias c='clear'
alias l="ls -FlAGh"
alias lo="ls -FlAGh | awk '{k=0;for(i=0;i<=8;i++)k+=((substr(\$1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(\"%0o \",k);print}'"
alias server="php -S 0.0.0.0:8080"
alias clearcache="sudo killall -HUP mDNSResponder"
alias pubkey="/bin/cat ~/.ssh/id_rsa.pub | pbcopy"
alias name="uname -n | tee /dev/ttys001 | pbcopy"
alias art="php artisan"
alias test="clear && phpunit"
@jeremyworboys
jeremyworboys / laravel
Last active Aug 29, 2015
Personal Laravel project bootstrapper
View laravel
#!/bin/bash
# Get project name
if [[ $1 == "" ]]
then
echo -n "Enter project name (or domain): "
read -e PROJECT_NAME
if [[ $PROJECT_NAME == "" ]]
then
@jeremyworboys
jeremyworboys / README.md
Created Jan 28, 2014
Domain Independent wp-config.php
View README.md

Dynamic Wordpress Config

This makes Wordpress play super friendly with Git :)

Usage

  1. Copy and paste this snippet in wp-config.php
  2. Enter the hostname of your production server on line 24
  3. Setup your database credentials for production and development (you can add more environments by adding a new case using that server's hostname)
  4. Replace the keys and salts block with the contents of https://api.wordpress.org/secret-key/1.1/salt/
@jeremyworboys
jeremyworboys / Data only.html
Created Oct 27, 2013
Separation of concerns with MVVM EE Stash
View Data only.html
{!-- model.html --}
{exp:channel:entries
channel="work"
url_title="{stash:url_title}"
require_entry="yes"
{global:disable}
}
{exp:stash:set_list name="images"}
{post_carousel_images}
View DefaultsModel.php
<?php
trait DefaultsModel {
/**
* Default values to seed the model with
* @var Array
*/
protected $defaults = array();
You can’t perform that action at this time.