Skip to content

Instantly share code, notes, and snippets.

View woffleloffle's full-sized avatar

Willem Labuschagne woffleloffle

View GitHub Profile
@woffleloffle
woffleloffle / hash1
Created November 14, 2013 07:37
An export of Clicking Bad - near completion. http://clickingbad.nullism.com/
eyJzdiI6eyJjIjoiMjlubWZlZzdpMmIiLCJjcyI6IjI4ZGswZWMzbGVhIiwidyI6IjczazBlNDkiLCJjbCI6ImMxOjF8YzI6MXxjMzoxfGM0OjF8YzU6MXxjNjphfGM3OjE5fGM4OmN8Yzk6Y3xjMTA6bHxjMTE6a3xjMTI6YXxjMTM6N3xjMTQ6M3xjMTU6MXxjMTY6MXxjMTc6MCIsInNsIjoiczE6MXxzMjoxaGh8czM6MXxzNDo4OHxzNTo4OHxzNjo0NHxzNzprfHM4OmF8czk6YXxzMTA6NDR8czExOmF8czEyOmZ8czEzOjd8czE0OjJ8czE1OjF8czE2OjF8czE3OjAiLCJibiI6ImIxOjF8YjI6YXxiMzoyY3xiNDoxZ3xiNTprfGI2OmN8Yjc6YXxiODo3fGI5OjJ8YjEwOjJ8YjExOjF8YjEyOjF8YjEzOjIiLCJ1IjoidTAxfHUwMnx1MDN8dTA0fHUwNXx1MDZ8dTA3fHUwOHx1MDl8dTEwfHUxMXx1MTJ8dTEzfHUxNHx1MTV8dTE2fHUxN3x1MTh8dTE5fHUyMHx1MjF8dTIyfHUyM3x1MjR8dTI1fHUyNnx1Mjd8dTI4fHUyOXx1MzB8dTMxfHUzMnx1MzN8dTM0fHUzNXx1MzZ8dTM3fHUzOHx1Mzl8dTQwfHU0MXx1NDJ8dTQzfHU0NHx1NDV8dTQ2fHU0N3x1NDcuMXx1NDh8dTQ5fHU1MHx1NTAuMXx1NTAuMnx1NTF8dTUyfHU1M3x1NTR8dTU1IiwicyI6InNlbGxlcl9ycHM6YzAyMWE3aXxjbGlja2VyX3JwczpjNjA2OW5mfGJhbmtfcnBzOjEzZTc1YTZoN2h8Y2hlYXRlZF93aWRnZXRzOjB8Y2hlYXRlZF9jYXNoOjB8aGFuZF9tYWRlX3dpZGdldHM6ZGw0YW4zbG1kOXxtYWRlX3dpZGdldHM6MTBmaWc1YWJtZzkuM2l8c29sZF93aWRnZXRzOjEwbWU3YWNuZ21kLjI2
@woffleloffle
woffleloffle / echo-print
Created February 21, 2014 12:23
Sublime Snippet to wrap a `print_r` with `pre` tags.
<snippet>
<content><![CDATA[
echo "<pre>";
print_r (\$${1:variable});
echo "</pre>";
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>echopre</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
@woffleloffle
woffleloffle / sendmail.php
Created May 8, 2014 14:48
Super simple HTML mailer sender in PHP
<?php
/**
* Basic mailer.
* @author Willem Labu
*
*
*/
// Edit this:
@woffleloffle
woffleloffle / README.md
Last active September 24, 2018 09:08
A better `git log`

A Better git log

This is basically the first thing I do after installing git.

From here by Filipe Kiss.

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@woffleloffle
woffleloffle / JS Object Merge
Last active August 29, 2015 14:06
Merging two JS Objects into one
/**
* Merge two JS Objects
*
* returns a new Object with values of
* first and second added to each other.
*
* Note:
* Object items should only have integers for values
* ..otherwise, boom!
*/
@woffleloffle
woffleloffle / remove_node_modules.bat
Created October 13, 2014 21:49
Delete pesky `node_modules` folders that are too long in one fell sweep.
mkdir em && robocopy em node_modules /MIR
rmdir em && rmdir node_modules
@woffleloffle
woffleloffle / README.md
Created January 27, 2016 09:12
Squash git commits together.

git squash alias

From here.

Run git config --global --edit and add the following under the [alias] section.

squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
@woffleloffle
woffleloffle / get-pip.py
Created June 29, 2016 17:07
Get pip using `python get-pip.py`
This file has been truncated, but you can view the full file.
#!/usr/bin/env python
#
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip.
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
@woffleloffle
woffleloffle / parser.js
Created October 29, 2016 08:04
Parse multipart/form-data in JavaScript
/**
* This parses multipart/form-data when passed into a Lambda function through
* API Gateway using the following Integration Request Mapping Template:
#set($allParams = $input.params())
{
"body" : $input.json('$'),
"params" : {
#foreach($type in $allParams.keySet())
#set($params = $allParams.get($type))
@woffleloffle
woffleloffle / MarkdownPreview.sublime-settings
Created August 15, 2017 10:11
Better Markdown Preview user settings
{
"enable_highlight": true,
"github_mode": "gfm",
"github_inject_header_ids": true,
"enable_autoreload": true,
}