Skip to content

Instantly share code, notes, and snippets.

@robballou
robballou / example.sh
Last active January 9, 2018 20:38
Bash examples for my own memory's sake...
#!/bin/bash
# check number of arguments, output a message to STDERR
if [[ "$#" -eq "0" ]]; then
2>&1 echo "Usage: $0 FILE"
exit 1
fi
# check if an argument equals a string
if [[ "$1" = "dev" ]]; then
@robballou
robballou / settings.php
Last active May 30, 2017 18:42
Drupal 8 basic settings file (for development)
<?php
assert_options(ASSERT_ACTIVE, TRUE);
\Drupal\Component\Assertion\Handle::register();
$databases = [
'default' => [
'default' => [
'driver' => 'mysql',
'database' => '',
'username' => '',
<?php
$base_dir = __DIR__ . '/PATH_TO_SITE/sites/all/modules/features';
function drupal_parse_info_format($data) {
$info = array();
$constants = get_defined_constants();
if (preg_match_all('
@^\s* # Start at the beginning of a line, ignoring leading whitespace
@ardcore
ardcore / atom-events
Last active October 13, 2021 20:35
atom.io events
application:open-your-keymap
application:open-your-stylesheet
autocomplete:attach
autoflow:reflow-paragraph
bookmarks:clear-bookmarks
bookmarks:jump-to-next-bookmark
bookmarks:jump-to-previous-bookmark
bookmarks:toggle-bookmark
bookmarks:view-all
check:correct-misspelling
function voff() {
DATVM=`VBoxManage list runningvms | awk '{gsub(/"/, "", $1); print $1}'`
VBoxManage controlvm $DATVM poweroff
}
@robballou
robballou / settings.php
Last active December 29, 2015 00:29
A basic Drupal dev site settings file.
<?php
/**
* @file
* Settings.
*/
$databases = array(
'default' => array(
'default' => array(
'database' => '',
@atmos
atmos / heaven.md
Last active November 23, 2020 22:35
Response to a dude who asked about heaven. https://github.com/holman/feedback/issues/422

@holman got a request about our deployment system, heaven

I know it's not a high priority, but has there been any activity on open-sourcing the core Heaven gem?

There is. I've been working on extracting the non-GitHub specific parts into two gems. This first is a CLI portion called hades. The second is an HTTP API portion called heaven.

When you open source something previously used as in internal tool like Heaven, Hubot, Boxen, etc., how do you manage and hook in the parts that need to stay internal?

Normally I focus around four questions:

@robballou
robballou / gist:3955133
Created October 25, 2012 20:15
.gitconfig aliases
[alias]
d = diff
st = status -sb
co = checkout
ci = commit
br = branch
ps = !"git pull && git st"
l = log --name-status --abbrev-commit
ls = git log --name-status --abbrev-commit --pretty="%n%Cgreen%h%Creset | %cd | %Cblue%an%Creset"
p = push
@amites
amites / center_geo.py
Last active October 15, 2021 23:14
Center Geolocations
from math import cos, sin, atan2, sqrt
def center_geolocation(geolocations):
"""
Provide a relatively accurate center lat, lon returned as a list pair, given
a list of list pairs.
ex: in: geolocations = ((lat1,lon1), (lat2,lon2),)
out: (center_lat, center_lon)
"""
x = 0
@aarongustafson
aarongustafson / TinyMCE-config-HTML5.js
Created August 26, 2010 12:57
Working on a TinyMCE config that supports HTML5
// General
button_tile_map : true,
editor_selector : 'lg_mceEditor',
mode:'textareas',
theme : 'advanced',
// Cleanup/Output
apply_source_formatting : true,
convert_fonts_to_spans : true,
convert_newlines_to_brs : false,