Skip to content

Instantly share code, notes, and snippets.

@bbrks
bbrks / Preferences.sublime-settings
Last active October 13, 2015 15:58
Sublime Text Configuration
{
// Code Style
"trim_automatic_white_space": false,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"translate_tabs_to_spaces": true,
"detect_indentation": true,
"tab_size": 2,
// Appearance
@bbrks
bbrks / parallax.js
Last active December 22, 2015 03:29
Super simple parallax scrolling
window.onscroll = function() {
var speed = 4.0;
var ypos = -window.pageYOffset / speed + "px";
var xpos = "50%";
var elems = document.getElementsByClassName('parallax');
for (var i = elems.length - 1; i >= 0; i--) {
elems[i].style.backgroundPosition = xpos +" "+ ypos;
};
}
@bbrks
bbrks / nukekeys.sh
Last active December 23, 2015 20:49
Easily regenerate SSH keys... just in case
#!/bin/sh
# nukekeys.sh
# Easily regenerate SSH keys... just in case
# https://gist.github.com/bbrks/6692143
read -p "WARNING: This will regenerate ALL *_rsa keys!! Are you sure? " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
@bbrks
bbrks / reset.scss
Last active December 31, 2015 15:29
Eric Meyer's CSS reset written in SCSS.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,
ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure,

Keybase proof

I hereby claim:

  • I am bbrks on github.
  • I am bbrks (https://keybase.io/bbrks) on keybase.
  • I have a public key ASB7RIaXIRVuF85CoXWdtFfhkXJTccYST1ohHeYX9DYsSAo

To claim this, I am signing this object:

@bbrks
bbrks / sublime-setup.md
Created July 15, 2015 23:15
[WIP] Rough guide for my personal Sublime Text setup

Packages

  • All Autocomplete
  • DocBlockr
  • GitGutter-Edge
  • SublimeCodeIntel
  • SublimeLinter
  • sublimeLinter-annotations
  • SublimeLinter-php
  • SublimeLinter-phpcs
  • SublimeLinter-phpmd
@bbrks
bbrks / consul.5s.sh
Last active August 24, 2016 13:38
Get a list of clickable consul services in BitBar
#!/bin/bash
# <bitbar.title>Consul Services</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Ben Brooks</bitbar.author>
# <bitbar.author.github>bbrooks</bitbar.author.github>
# <bitbar.desc>Displays services in Consul, along with their port numbers</bitbar.desc>
# <bitbar.image>https://i.imgur.com/RB7z44c.png</bitbar.image>
# <bitbar.dependencies>jq,curl</bitbar.dependencies>
# <bitbar.abouturl>https://github.com/matryer/bitbar-plugins/blob/master/Dev/Consul/consul_services.5s.sh</bitbar.abouturl>
#
div.pipeline-wrapper {
background: #2b3e50;
}
.rounded {
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 0;
}
@bbrks
bbrks / gist:22a5fc543bfb7a9f52d227cc38fad402
Created January 5, 2018 14:49
unexpected fault address 0xb01dfacedebac1e
unexpected fault address 0xb01dfacedebac1e
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x103518f]
goroutine 1332 [running]:
runtime.throw(0x1950cd3, 0x5)
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:605 +0x95 fp=0xc4209e0870 sp=0xc4209e0850 pc=0x105a925
runtime.sigpanic()
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/signal_unix.go:374 +0x227 fp=0xc4209e08c0 sp=0xc4209e0870 pc=0x1073147
runtime.hashGrow(0x193ac80, 0xc4209e2181)
@bbrks
bbrks / gist:40bdc3be1f7735d2489f1c04f98e9251
Created February 1, 2018 12:46
sg-replicate race log
12:44 $ go1.10rc1 build -race && ./sync_gateway config.json
2018-02-01T12:44:45.009Z Enabling logging: [*]
2018-02-01T12:44:45.009Z ==== /() ====
2018-02-01T12:44:45.009Z Configured process to allow 5000 open file descriptors
2018-02-01T12:44:45.009Z Opening db /db1 as bucket "db1", pool "default", server <http://127.0.0.1:8091>
2018-02-01T12:44:45.010Z GoCBCustomSGTranscoder Opening Couchbase database db1 on <http://127.0.0.1:8091> as user "Administrator"
2018-02-01T12:44:45.024Z Design docs for current SG view version (2.0) found.
2018-02-01T12:44:45.024Z Verifying view availability for bucket db1...
2018-02-01T12:44:45.029Z Views ready for bucket db1.
2018-02-01T12:44:45.029Z Cache: Initializing changes cache with options {ChannelCacheOptions:{ChannelCacheMinLength:0 ChannelCacheMaxLength:0 ChannelCacheAge:0s} CachePendingSeqMaxWait:5s CachePendingSeqMaxNum:10000 CacheSkippedSeqMaxWait:1h0m0s}