Skip to content

Instantly share code, notes, and snippets.

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wwhurley
wwhurley / Vagrantfile
Last active Nov 15, 2017
Vagrantfile to have MacOS use VBox synced files instead of NFS due to APFS issues
View Vagrantfile
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
View Vagrantfile
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 Jun 7, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Nov 30, 2015
Working purge.inc file
View purge.inc
<?php
/**
* @file
* Contains the main purging functionality and error handling
*/
/**
* Purges urls from reverse proxy caches
*
@wwhurley
wwhurley / gist:e64da2167e19ecf5ea5d
Created Nov 3, 2014
Vagrantfile.local updating boot timeout
View gist:e64da2167e19ecf5ea5d
Vagrant.configure("2") do |config|
config.vm.boot_timeout = 600
end
View 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
View gist:45234c99cb001d5defa8
/*
* 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'),
View gist:6908087
# 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 Nov 16, 2012
DerbyJS model manipulation
View gist:4091037
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) {