Skip to content

Instantly share code, notes, and snippets.

View Chris820's full-sized avatar

Chris Chris820

View GitHub Profile
@Chris820
Chris820 / Vagrantfile (Solr)
Created October 23, 2019 09:41
Creates a Vagrant VM running Solr 7.7. Suitable for local Drupal website development. The conf files can be found in the relevant Drupal module
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "private_network", ip: "192.168.33.11"
config.vm.network :forwarded_port, guest: 8983, host: 8983
# Memory and CPU cores
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
@Chris820
Chris820 / modal.js
Last active March 31, 2019 03:33
Chunk of jQuery that could be used to open up a linked URL into a modal. Although hasn't been used in a long while.
/* Modal Script */
jQuery(function($) {$(document).ready(function() {
/* Modal windows */
$.fn.thedialog = function(settings) {
// Options
var o = $.extend({
title: 'h1,h2,h3,h4,h5,h6,legend,label,p',
focus: 'a,input,button,select,textarea,[tabindex]',
buttons: false
@Chris820
Chris820 / Vagrantfile
Last active December 19, 2023 06:04
My Vagrantfile. Creates a LAMP environment suitable for Drupal and Wordpress development.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder "~/Documents/Sites", "/var/www/html", mount_options: ["dmode=777", "fmode=777"]
config.vm.synced_folder "~/vagrant-localdev/db-details", "/var/www/db-details"
config.vm.synced_folder "~/vagrant-localdev/configs", "/etc/apache2/sites-enabled"
config.vm.synced_folder "~/vagrant-localdev/logs", "/var/www/logs"
config.vm.synced_folder "~/vagrant-localdev/scripts", "/home/vagrant/scripts"
config.vm.synced_folder "~/Documents/Transfer", "/home/vagrant/transfer"
# Plenty of memory and CPU cores