Skip to content

Instantly share code, notes, and snippets.

View al-the-x's full-sized avatar

David Rogers AKA "AL the X" al-the-x

View GitHub Profile
@al-the-x
al-the-x / .tmuxrc
Created May 10, 2011 20:11 — forked from xentek/.tmux.conf
custom .tmux.conf (renamed to .tmuxrc) file for your multiplexing pleasure
###
# Custom tmux configuration cobbled together from google and trial & error
# by Eric Marden (xentek.net), heavily modified by David Rogers (@al-the-x).
##
# set the command prefix to match gnuscreen (i.e. CTRL+a)
set-option -g prefix C-a
# use the NEW prefix key to "send-prefix" instead of the default
unbind-key C-b; bind-key C-a send-prefix
@al-the-x
al-the-x / colorize-log.zsh
Created August 15, 2016 15:43
Colorize the output of any log with `ack` by piping to `colorize-log`
function colorize-log {
colorize red ERROR | \
colorize yellow 'WARN(ING)?' | \
colorize green INFO | \
colorize white DEBUG | \
colorize white TRACE
}
@al-the-x
al-the-x / experience__migrations__0008_auto_20190531_1221.py
Last active May 31, 2019 19:36
Where did these funky migrations come from?
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2019-05-31 19:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
@al-the-x
al-the-x / git-fu-the-learning-continues.markdown
Created May 24, 2018 13:47
Abstract for "Git Fu: The Learning Continues" for submission to HelpMeAbstract.com

Git Fu: The Learning Continues

You've been on this quest for a while now. Your trusty source control system is an old friend but also still an enigma at times. There are so many things that it can do for you, but you find yourself in the same old rut in your day-to-day: git status, git add, git commit, maybe a little git log thrown in there. Truth is, most Code Ninjas are mostly Git Fu Grasshoppers; you're not alone. You need to see these tricks, though:

  • So you know your way around a simple git rebase okay... but what is that really doing?
  • What happens when someone else rebases your base branch out from under you?
  • You've heard of them, but what are all these "cherries" and why do they need "picking"? Or squashing? Do you even squash cherries?
  • What do you do when you really futz up a merge... or a rebase… or when someone else does and you have to fix it? Isn't there a better way to resolve these conflicts? Again…
  • How do I really find out whodunnit for that post-mortem report… or which
@al-the-x
al-the-x / you-xss-your-life.markdown
Last active May 24, 2018 13:33
Abstract for "You XSS Your Life! -- How do we keep failing at security on the web?" for submission to HelpMeAbstract.com

You XSS Your Life! -- How do we keep failing at security on the web?

The Open Web Application Security Project (OWASP) has compiled a Top Ten list of security vulnerabilities every few years since 2003. One specific vulnerability has persistently appeared on every list: Cross-Site Scripting (XSS) aka the injection of malicious JavaScript. JavaScript is quickly becoming the most popular –– or possibly most used –– programming language in the world; more developers and tools are joining the ecosystem every day.

Despite over 10 years of awareness through highly visible exploits and education through OWASP Top Ten, despite thousands of new and experienced developers entering the field of JavaScript over that decade, and despite fancy new tools and frameworks meant to protect us from XSS, how can XSS really have raised in rank on the vulnerability list?

In this presentation, I'll break down how XSS works in theory and in practice, what the OWASP Top Ten is and why it's important, tell some stories about nota

@al-the-x
al-the-x / notes.md
Created February 7, 2014 19:11
Tips from @rasmus about atomic deployments...

The only way to have atomic (code) deploys:

  • Don't copy files into current document root
  • Let existing requests finish on old code
  • New requests start on new code
  • Avoid clearing your opcode cache
  • Minimal impact on production traffic

Breakdown:

@al-the-x
al-the-x / env.php
Created October 23, 2012 17:52
Finding OPENSHIFT environment variables in PHP / Zend Server
<?php
$find_openshift_db = function($variables){
$keys = array_filter(array_keys($variables), function($key){
return (strpos($key, 'OPENSHIFT') === 0);
});
return array_intersect_key($variables, array_flip($keys));
};
?>

An often-referenced acronym for meeting agendas. I stole the idea for a gist from @aaronbuchanan, who cites Market Footprint (blog) as the original source.

  • Purpose: What is the purpose of the meeting?
  • Objective: What are you trying to achieve in the meeting, and what does success look like?
  • Structure: What is the structure of the meeting we are having?
  • Timing: How much time is allocated to the meeting?
@al-the-x
al-the-x / breakup.go
Last active October 24, 2016 14:57
Given a string `word` of arbitrary length insert character `char` into `word` every `N` characters without modifying `word`...
func drewboyuka__breakup(s, placeholder string, n int) string {
var buf []byte
for ; len(s) > n; s = s[n:] {
buf = append(buf, s[:n]...)
buf = append(buf, placeholder...)
}
buf = append(buf, s...)
return string(buf)
}
@al-the-x
al-the-x / reviewable--bindings.json
Last active September 14, 2016 13:29
Customized key bindings for Reviewable (http://reviewable.io) via Mousetrap (https://craig.is/killing/mice)
[
["f", "Show next/latest diffs", "setProposedRevRanges()"],
["n", "Next unreviewed file", "nextUnreviewedFile()"],
["p", "Previous unreviewed file", "prevUnreviewedFile()"],
["shift+n", "Next changed file", "nextChangedFile()"],
["shift+p", "Previous changed file", "prevChangedFile()"],
[null, "Next visible file", "nextVisibleFile()"],
[null, "Previous visible file", "prevVisibleFile()"],