Skip to content

Instantly share code, notes, and snippets.

@wwhurley
wwhurley / machine.js
Last active October 9, 2019 17:00
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wwhurley
wwhurley / Vagrantfile
Last active November 15, 2017 17:31
Vagrantfile to have MacOS use VBox synced files instead of NFS due to APFS issues
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "bento/centos-6.9"
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "90", "--memory", "4096", "--cpus", "4"]
end
end
@wwhurley
wwhurley / 0_reuse_code.js
Created June 7, 2016 00:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wwhurley
wwhurley / purge.inc
Created November 30, 2015 21:11
Working purge.inc file
<?php
/**
* @file
* Contains the main purging functionality and error handling
*/
/**
* Purges urls from reverse proxy caches
*
@wwhurley
wwhurley / gist:e64da2167e19ecf5ea5d
Created November 3, 2014 17:25
Vagrantfile.local updating boot timeout
Vagrant.configure("2") do |config|
config.vm.boot_timeout = 600
end
@wwhurley
wwhurley / Vagrantfile.local
Created September 19, 2014 18:57
Vagrantfile.local
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
end
/*
* Implements hook_user_operations().
*
* Creates an action to unblock a user and additionally remove information
* related to past login attempts.
*/
function mymodule_security_user_operations() {
return array(
'unblock_and_clear' => array(
'label' => t('Unblock selected users and clear failed login attempts'),
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
include "acl.vcl";
include "backends.vcl";
@wwhurley
wwhurley / gist:4091037
Created November 16, 2012 21:22
DerbyJS model manipulation
var model = store.createModel();
// Creation of AMQP connection, exchange and queue
model.subscribe('messages', function(err, messages) {
model.on('set', 'messages.*', function(id, message) {
exchange.publish('collector', message);
});
queue.subscribe(function (message, headers, deliveryInfo) {