Skip to content

Instantly share code, notes, and snippets.

View alex-phillips's full-sized avatar

Alex Phillips alex-phillips

View GitHub Profile
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@maciej
maciej / git-change-date.sh
Last active July 25, 2018 15:05
git: Change the commit and/or author date of git commits.
#!/bin/sh
#
# Change the commit and/or author date of git commits.
#
# change-date [-f] commit-to-change [branch-to-rewrite [commit-date [author-date]]]
#
# If -f is supplied it is passed to "git filter-branch".
#
# If <branch-to-rewrite> is not provided or is empty HEAD will be used.
@ironicbadger
ironicbadger / convert.sh
Last active September 3, 2018 15:44
automated audiobook DRM stripping
#!/bin/bash
# ./convert -a asdfghjk
# Obtain an activation_bytes string and plug it into this script with -a.
FILES=aax/*
OUTPUT=mp3
while getopts a: option
do
case "${option}"
@antonmedv
antonmedv / DotNotation.php
Last active August 11, 2022 13:47
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@IcyEyeG
IcyEyeG / wmd2git.pl
Created October 20, 2019 11:08
Storing a wayback-machine-downloader website in a git repository
#!/usr/bin/perl
#This is a perl script intended to be used with a JSON file generated by https://github.com/hartator/wayback-machine-downloader and aims to convert an entire website archived with the wayback machine into a git repository with commits that correspond to a modification in a snapshot file.
#Some limitations of wayback-machine-downloader are dealt with, making this script quite slow:
# - wget is used so files are downloaded with proper modification timestamp
# - HTML files are scraped from their embeded Internet Archive code and links
# - duplications are found and discarded using MD5 comparison
#This is just a proof of concept that only works in Linux and it uses quite a few hacks to get it done
#If you want to convert or port this concept into a project, please follow GPLv3 (https://www.gnu.org/licenses/gpl-3.0.html)
@bradwilson
bradwilson / .gitconfig
Last active January 22, 2023 21:51
~/.config/git/config
[user]
name = Brad Wilson
email = dotnetguy@gmail.com
signingkey = 0B7BD15AD1EC5FDE
[alias]
a = add -A
abort = rebase --abort
amend = commit --amend -C HEAD
bclean = "!f() { git switch ${1-main} && git branch --merged ${1-main} | grep -v ${1-main}$ | xargs git branch -d; }; f"
bdone = "!f() { git switch ${1-main} && git up && git bclean ${1-main}; }; f"
@jpriebe
jpriebe / del_vpc.py
Last active February 3, 2023 22:08
#!/usr/bin/env python3
#### borrowed heavily from https://stackoverflow.com/questions/53519058/how-to-delete-vpc-with-all-its-dependencies-using-boto3
#### also found this online: https://github.com/jeffbrl/aws-vpc-destroy/blob/master/vpc_destroy.py
import boto3
import json
import re
import sys
from pprint import pprint
@eddmann
eddmann / SecureSessionHandler.php
Created April 9, 2014 12:18
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik