Skip to content

Instantly share code, notes, and snippets.

View sanguis's full-sized avatar
👁️‍🗨️
DevOpsing all the things

Josh Beauregard sanguis

👁️‍🗨️
DevOpsing all the things
View GitHub Profile
Sidney Dekker
The Field Guide to Human Error - https://amzn.to/2O30hAI
Just Culture - https://amzn.to/2XSsIpD
RULE- AND ROLE-RETREAT: AN EMPIRICALSTUDY OF PROCEDURES AND RESILIENCE - https://bit.ly/2F9is5e
Erik Hollnagel
From Safety-I to Safety-II: A White Paper - https://www.skybrary.aero/bookshelf/books/2437.pdf
Joint Cognitive Systems: Patterns in Cognitive Systems Engineering - https://amzn.to/2u8jhVE
Resilience engineering – Building a Culture of Resilience - https://bit.ly/2J8Calz
@aaronott
aaronott / install_drush_globally
Last active August 29, 2015 14:07
Quickly install latest drush globally with composer
#!/bin/bash
set -x
# This assumes that composer is already installed
sudo mkdir -p /usr/share/composer \
&& sudo composer -vvv global require drush/drush:dev-master --working-dir=/usr/share/composer \
&& sudo ln -s /usr/share/composer/vendor/drush/drush/drush /usr/local/bin/drush
@sanguis
sanguis / vhost.conf
Last active August 29, 2015 13:58 — forked from anonymous/nginx.conf
nginx redirecting all non ssl/www traffic to https://www...
server {
listen 443 spdy;
listen 80;
server_name foo.org www.foo.org;
root /home/site/public;
#if ($request_method !~ "^(GET|HEAD|POST)$" ) { return 444; }
if ($https != 'on') { return 301 https://www.foo.org$request_uri; }
if ($host = "foo.org") { return 301 https://www.foo.org$request_uri; }
@robballou
robballou / gist:5871098
Last active December 19, 2015 00:49
Use dpq() in Drupal to write the SQL query to a file.
<?php
$query = db_select('node', 'n');
$string = dpq($query, TRUE);
dd($string);
@cyberswat
cyberswat / gist:5678391
Created May 30, 2013 14:43
A sample LWRP per #drupal-colorado conversation
require 'fileutils'
require 'tempfile'
action :ensure do
t_file = Tempfile.new('/root/.profile_temp')
::File.open(new_resource.profile, 'r') do |f|
f.each_line do |line|
if line.match(/PATH=/)
if ::File.readlines(new_resource.profile).grep(/:#{new_resource.path.gsub('/','\/')}/).length > 0
t_file.puts line
@naxoc
naxoc / pre-commit
Created November 26, 2012 21:05
Drupal git commit hook
#!/usr/bin/php
<?php
/**
* @file
* This is a Git pre-commit hook that informs you when you are
* about to commit whitespace or a debug function.
*/
$red = "\033[1;31m";
$red_end = "\033[0m";
@kid-icarus
kid-icarus / gist:4126352
Created November 21, 2012 17:38
recursive slam dunk
/**
* Adds an #ajax property recursively to all elements of a form.
*
* @param array $element
* The first element to recursively apply #ajax to.
*/
function recursive_ajax(&$element) {
if (element_children($element)) {
foreach (element_children($element) as $child) {
recursive_ajax($element[$child]);
@sanguis
sanguis / .vimrc
Last active September 25, 2015 09:58
my vimrc file optimized fro drupal development
"general vim rc settings
set term=xterm-color
set smartcase " match 'word' case-insensitive and 'Word' case-sensitive
set showmatch " shows matching parenthesis, bracket, or brace
set showcmd " show commands while they're being typed
set incsearch " searches as you type
syntax on " syntax highlighing
set background=dark " adapt colors for background
:colorscheme desert
set vb t_vb=