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 / 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

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()"],
@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 / Algorithms.md
Last active May 4, 2016 20:52
Bloc.io Teacher Assessment

Algorithms

Hey mentor,

I hope you're doing well. I'm really enjoying learning algorithms, but I'm pretty confused by this Big O Notation thing. Can you explain how I'm supposed to figure out which notation my algorithm uses?

-Student


@al-the-x
al-the-x / index.html
Created October 6, 2015 13:39
vNmJRe
<nav class="tabs">
<a href="#">Contributions</a>
<a href="#" class="active">Repositories</a>
<a href="#">Activity</a>
</nav>
@al-the-x
al-the-x / main.js
Last active October 5, 2015 01:15
Explaining the IIFE pattern _and_ `require` at the same time to TIY-Durham/2015-FALL-FEE
;(function(globals){ // That IIFE though...
// In Node JS: module.exports.hello = hello;
// In Browser: window.hello = hello;
globals.hello = hello;
// In Node JS: module.exports.hello();
// In Browser: window.hello();
globals.hello();
function hello(){