Skip to content

Instantly share code, notes, and snippets.

Working on too many things.

Alan Hardman Alanaktion

Working on too many things.
Block or report user

Report or block Alanaktion

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Alanaktion / timing-attack.php
Last active Jun 12, 2018
Silly timing attack POC in PHP
View timing-attack.php
$iterations = 1e4;
$valid = 'password';
$stored_hash = md5($valid);
$test = $arvg[1] ?? 'notvalid';
echo "$iterations iterations\n";
// Run tests
$v_start = microtime(true);
Alanaktion / Celeste Dark.sublime-color-scheme
Last active Mar 21, 2019
Celeste Dark Sublime Text Theme
View Celeste Dark.sublime-color-scheme
// Rough modified version of Celeste to darken it up
"name": "Celeste Dark",
"author": "Sublime HQ Pty Ltd",
// These colors are part of the hashed range
// and should only be used in non-source
"purple": "hsla(260, 50%, 70%, 1)",
"blue": "hsla(200, 70%, 55%, 1)",
Alanaktion /
Created Apr 16, 2018
Pacman hooks to keep kernel modules

These Pacman hooks can be used to keep old kernel modules active without rebooting. This can work around issues like new USB devices and Docker images not working properly after a kernel upgrade, but before a reboot.

Add the files to /etc/pacman.d/hooks to enable the functionality. It works by making a backup of your current kernel's /lib/modules/... directory before the new kernel is installed, and then moving it back to the /lib/modules directory after the installation completes, working around the default behavior of deleting the old modules.

You can manually clean up the files after a reboot if you're concerned about the disk space used.

Alanaktion / magento_url_rewrite.patch
Last active Dec 5, 2017 — forked from edannenberg/magento_url_rewrite.patch
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x
View magento_url_rewrite.patch
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
Alanaktion / .gitconfig
Last active Sep 16, 2019
Global Git config
View .gitconfig
name = Alan Hardman
email =
signingkey = 27A79A65774B4AF0
default = simple
ignored = !git ls-files -v | grep ^[[:lower:]]
sync = !sh -c 'git pull --no-edit && git push'
st = status
Alanaktion / Monokai Breeze.tmTheme
Created Nov 13, 2017
Monokai color scheme adjusted to match Breeze theme
View Monokai Breeze.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Monokai Soda</string>
Alanaktion / Default (Linux).sublime-mousemap
Created Nov 13, 2017
Windows-style mouse bindings for Sublime Text on Linux
View Default (Linux).sublime-mousemap
"button": "button3",
"press_command": "drag_select",
"press_args": {"by": "columns"}
"button": "button3", "modifiers": ["ctrl"],
"press_command": "drag_select",
"press_args": {"by": "columns", "additive": true}
Alanaktion / upgrade.php
Last active Nov 9, 2017 — forked from colinmollenhour/cleanCache.php
Safely run Magento 1.x upgrade scripts via CLI
View upgrade.php
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
* It should be placed in the shell/ directory, and must be run via CLI.
if(strtolower(php_sapi_name()) != 'cli'){
Alanaktion / f3ws-chat.php
Created Oct 13, 2017
Minimal chat server on F3 WS
View f3ws-chat.php
require_once 'vendor/autoload.php';
$ws = new \CLI\WS('localhost:8033');
$nicks = [];
// Handle agent connections
$ws->on('connect', function($agent) {
echo sprintf("Client %s connected\n", $agent->id());
Alanaktion / elastic.php
Created Sep 6, 2017
Phproject/Elasticsearch test integration
View elastic.php
* Elasticsearch importer and test client
require_once 'vendor/autoload.php';
$f3 = Base::instance();
'UI' => 'app/view/',
You can’t perform that action at this time.