Skip to content

Instantly share code, notes, and snippets.

View aqualad's full-sized avatar

Brook Dodd aqualad

  • Cleveland, OH
  • 01:01 (UTC -05:00)
View GitHub Profile
@aqualad
aqualad / ES6-Debounce-Test.js
Created August 8, 2016 02:18
Testing ES6 fat arrow and lodash debounce together
function foo(s) { console.log(s); };
let d = _.debounce((s) => foo(s), 500);
$newEl = document.createElement('button');
$newEl.onclick = d;
$target = document.body;
$target.insertBefore($newEl, $target.childNodes[0]);
@aqualad
aqualad / Preferences.sublime-settings
Created July 26, 2016 14:46
Sublime Preferences for Mac
{
"color_scheme": "Packages/User/SublimeLinter/Monokai JSON+ (SL).tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"font_size": 14,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
@aqualad
aqualad / message_query_with_cte.sql
Last active July 6, 2016 17:41
slightly better message query
with filtered_messages as (
SELECT message.linked_message_id,
message_type.description,
message.sender_id
FROM message
JOIN alert_state
ON message.alert_state_id = alert_state.id
JOIN message_type
ON message.message_type_id = message_type.id
WHERE message.v2organization_id = 978
{
"color_scheme": "Packages/User/SublimeLinter/Monokai JSON+ (SL).tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"font_size": 14,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
<snippet>
<content><![CDATA[
import ipdb; from pprint import pprint; ipdb.set_trace();
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ipdb</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
<description> IPDB Trace</description>
</snippet>
@aqualad
aqualad / .eslintrc
Created May 25, 2016 05:06 — forked from guocheng/.eslintrc
A eslint config file for linting react/jsx and ES6 syntax. This file is based on (https://gist.github.com/cletusw/e01a85e399ab563b1236) and (https://github.com/kriasoft/react-starter-kit/blob/master/.eslintrc). Note that I use single quote in the rules, to change it, lookup 'quotes' and change it to `"quotes": [1, "double"].
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},
"ecmaFeatures": {
"jsx": true,
"modules": true,
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;32m\]@\[\033[01;34m\]\h\[\033[01;32m\]:\[\033[01;32m\]\w\[\033[01;34m\]\$\[\033[00m\] "
# export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export HISTFILESIZE=10000000
alias diff="colordiff -Iy"
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
@aqualad
aqualad / cheatsheet-git.sh
Created April 6, 2016 19:38 — forked from raineorshine/cheatsheet-git.sh
Cheatsheet: git commands
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)
@aqualad
aqualad / bot.js
Last active January 5, 2016 17:55
bot.js where I started to implement a list of currently pressed keys
var five = require("johnny-five");
var Particle = require("particle-io");
var keydownup = require("keyupdown");
// Store process.stdin to a local variable
var stdin = process.stdin;
// Store keys currently pressed
var pressed = {};
//How to validate selectize.js comboboxes with the jQuery validation plugin
//selectize.js: http://brianreavis.github.io/selectize.js/ (brianreavis/selectize.js)
//http://jqueryvalidation.org (jzaefferer/jquery-validation)
//configure jquery validation
$("#commentForm").validate({
//the default ignore selector is ':hidden', the following selectors restore the default behaviour when using selectize.js
//:hidden:not([class~=selectized]) | selects all hidden elements, but not the original selects/inputs hidden by selectize
//:hidden > .selectized | to restore the behaviour of the default selector, the original selects/inputs are only validated if their parent is visible
//.selectize-control .selectize-input input | this rule is not really necessary, but ensures that the temporary inputs created by selectize on the fly are never validated