Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dholmes on github.
  • I am dholmes (https://keybase.io/dholmes) on keybase.
  • I have a public key whose fingerprint is D560 F840 7AEE F69D F136 0A8A FEFF 9EE7 DDF2 1183

To claim this, I am signing this object:

@dholmes
dholmes / Vagrantfile-rsync-or-nfs.txt
Created May 9, 2018 15:12
Just a snip-it of a Vagrantfile that could be helpful for using either TCP nfs or rsync with the gatling-rsync plugin
# Mounts
(settings['volumes'] || {'.' => '/vagrant'}).each do |src, dst|
if Vagrant.has_plugin?("vagrant-gatling-rsync")
config.vm.synced_folder src, dst, type: "rsync", rsync__exclude: [".git/", ".idea/"], rsync__verbose: true
else
config.vm.synced_folder src, dst, type: "nfs",  mount_options: ['rw', 'vers=3', 'tcp'], linux__nfs_options: ['rw','no_subtree_check','all_squash','async']
end
end
@dholmes
dholmes / sync-vagrant-to-host.md
Last active April 16, 2018 21:20
Syncing select files from Vagrant to Host when using gatling-rsync-auto
  1. Be sure to stop gatling-rsync-auto so it doesn't delete whatever you are trying to generate
  2. Run whatever file-generating thing inside the VM
scp -rv -P 2222  -i /Users/dholmes/Projects/someapp/config/keys/private -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null vagrant@127.0.0.1:/vagrant/app/build/coverage/ app/build/coverage/

Dan's quick start build for Craft project

  1. Download craft from http://buildwithcraft.com/docs/installing
  2. Use puphpet.com to generate a new server build:
    • Shared Folder / Folder Source: ../
    • System Packages: htop, curl, vim (because I like having them)
    • Nginx Host
      • Server Name: craft-demo.dev
      • Server Alias: if not needed
  • Document Root: /var/www/public
@dholmes
dholmes / kcphpug-homestead.md
Last active October 7, 2015 19:39
Notes for Homestead Talk - KC PHPUG / 2015-09-05

Dan's quick guide to adding a Homestead VM to your project

I'm always on the lookout for great ways to answer the question "How do I get started in PHP?" Sometimes, the hardest part is figuring out the server side of it, and everything you need to build something.

Homestead is a pre-configured, virtual server in a box. Easy to add to your project and has probably more services than you need but things you maybe haven't tried because you didn't know how to install them.

It is not a replacement for tools like Ansible|Chef|Puppet or even Docker--you can use those tools to script building not only your dev VM, but testing and production servers as well. But if you are looking for a quick way to add a dev VM to your project, or don't yet know the difference between Postfix and clearfix--those bigger tools can wait.

PreRequisites

Install

  • [VirtualBox]
@dholmes
dholmes / VagrantFile
Created July 28, 2015 20:56
Chunk of VagrantFile that I include the "hack" for -- seemed to address the issue.
config.vm.provision :puppet do |puppet|
puppet.facter = {
"hack=hack LANG=en_US.UTF-8 hack" => "hack",
'fqdn' => "#{config.vm.hostname}",
'ssh_username' => "#{ssh_username}",
'provisioner_type' => ENV['VAGRANT_DEFAULT_PROVIDER'],
}
puppet.manifests_path = "#{data['vm']['provision']['puppet']['manifests_path']}"
puppet.manifest_file = "#{data['vm']['provision']['puppet']['manifest_file']}"
puppet.module_path = "#{data['vm']['provision']['puppet']['module_path']}"
@dholmes
dholmes / gist:00a4f9b45a7ad9a9301a
Created September 30, 2014 16:35
JS Inheritance the wrong way (apparently)
// Still trying to get the handle on JS OO - WAY too many years in C++ style languages I guess
// Anyway, for looking at later
function Collection() {
this.nextNewId = 1;
this.count = 0;
this.data = {};
}
Collection.prototype.getAll = function(){

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

@dholmes
dholmes / gist:3102932
Created July 13, 2012 05:34
[wp-snippet] sidebar navigation
<?php
//if the post has a parent
$title = "";
global $post;
if($post->post_parent){
//collect ancestor pages
$relations = get_post_ancestors($post->ID);
//add current post to pages
array_push($relations, $post->ID);
@dholmes
dholmes / gist:1278657
Created October 11, 2011 16:50
Dojo function for running through a bunch of dojo checkboxes, setting their disabled flag. Focus forces repaint.
function setFormState(disabled){
dijit.registry.forEach(function(w){
if(w.name.search(/application/i) >= 0){
w.disabled = disabled;
w.focus();
}
});
}