Skip to content

Instantly share code, notes, and snippets.

View wpalmer's full-sized avatar

Will Palmer wpalmer

View GitHub Profile
html::after {
content: "DEVELOPMENT";
text-transform: uppercase;
font-family: monospace;
font-size: 15px;
font-weight: bold;
text-align: center;
color: white;
display: block;
From 443bd2f22db090019e3f49676890a57e947a56ac Mon Sep 17 00:00:00 2001
From: Will Palmer <will@do-it-well.co.uk>
Date: Wed, 12 Oct 2016 10:43:19 +0100
Subject: [PATCH] [TEMPORARY FIX] bind criteo late, to fix filters
Criteo's observer, which iterates over products, was bound to the event
controller_action_layout_load_before. This was a problem because Layered
Navigation is applied during the layout load, in:
core/Mage/Catalog/Block/Layer/View.php#_prepareLayout()
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an example taken from Atom's built-in keymap:
@wpalmer
wpalmer / ssl-cert-split.sh
Created April 30, 2016 23:14
Split a combined SSL certificate file into component parts (key and individual certificates)
#!/bin/bash
TEMP="$(mktemp --tmpdir -d 'ssl.XXXXXXXXXX')"
[ -n "$TEMP" -a -d "$TEMP" -a -w "$TEMP" ] || exit 1
_cleanup(){ rm -rf "$TEMP"; }
trap _cleanup EXIT
file="$1"
cert="$TEMP/cert"
now="$(date --utc +'%Y%m%d%H%M%S')"
i=1
// https://nodejs.org/api/http.html#http_http_request_options_callback
var req = http.request(options);
req.end();
req.on('upgrade', (res, socket, upgradeHead) => {
console.log('got upgraded!');
socket.end();
process.exit(0);
});
@wpalmer
wpalmer / git-merge-single.sh
Created April 7, 2016 16:52
written but not run - merge a single file
#!/bin/bash
TEMP="$(mktemp --tmpdir -d 'git-merge-single.XXXXXXXXXX')"
[ -n "$TEMP" -a -d "$TEMP" -a -w "$TEMP" ] || exit 1
_cleanup(){ rm -rf "$TEMP"; }
trap _cleanup EXIT
their_commit="${1%%:*}"
file="${1#*:}"
git cat-file blob "$their_commit:./$file" > "$TEMP/theirs"
do_stuff(){
// ensure parameters are valid, returning API errors related to validation if they're not
// attempt to actually do stuff, returning API errors related to processing failure if we can't
}
# php artisan routes
+--------+-------+-------+---------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+-------+-------+---------+----------------+---------------+
| | GET / | | Closure | | |
+--------+-------+-------+---------+----------------+---------------+
@wpalmer
wpalmer / Lando Launcher.craft
Created September 6, 2013 23:27
Lando Launcher - gets a Lando Rover into orbit, but not safely to the Mun
ship = Lando Launcher
version = 0.21.1
description =
type = VAB
PART
{
part = cupola_4294788916
partName = Part
pos = -0.458981,34.25574,3.257305
rot = 0,0.7071068,0,-0.7071068
@wpalmer
wpalmer / bisect.js
Created September 25, 2012 05:48
Sizzle quoted selector bisect -> af8206ff677909e61aec0158443ff74263e6265b
#!/usr/bin/env phantomjs
var page = require('webpage').create();
page.open("file:///Users/wpalmer/git/sizzle/t.html", function(status){
try {
phantom.exit(
page.evaluate(function(){
return window.Sizzle('p:eq("3")');
}).length !== 0
)
} catch(e) {