Skip to content

Instantly share code, notes, and snippets.

View avar's full-sized avatar

Ævar Arnfjörð Bjarmason avar

View GitHub Profile
diff --git a/faq.fmt b/faq.fmt
index a671bc6..d5511e7 100644
--- a/faq.fmt
+++ b/faq.fmt
@@ -56,12 +56,12 @@ surface and make the first in-situ subsurface analysis of its composition.
It will also be the first mission to investigate a comet’s nucleus
and environment over an extended period of time.
-How will Rosetta reach comet 67P/Churyumov-Gerasimenko, and how long will
-it take? Comet 67P/Churyumov-Gerasimenko loops around the Sun between
@avar
avar / redis-expiry.pl
Last active August 29, 2015 13:56
Test the Redis SCAN command
use strict;
use warnings;
use Redis;
my $what = $ARGV[0] || "create";
my $r = Redis->new(server => "127.0.0.1:6379");
my $num_keys = 100_000;
@avar
avar / mason-detect-clobbered-symbols.pl
Last active August 29, 2015 13:56
Some code snippets of code I'm using to detect when Mason clobbers subroutines in HTML::Mason::Commands during a request
## Utility function to get a copy of subroutines in a given namespace:
sub copy_of_code_symbols {
my ($symbol_table) = @_;
my %copy = map {
+($_ => *{$symbol_table->{$_}}{CODE});
} grep {
my $name = $_;
# Maybe it's not a code symbol
@avar
avar / things-to-do-in-iceland.md
Last active June 27, 2023 18:31
Recommendations for things to do in Iceland

I get asked by people wanting to visit Iceland what they should do while they're there. Rather than re-type (and mostly forget) the whole thing I just give them a link to this.

Stuff that isn't this guide

...as if you didn't know how to use Google.

  • I'm partial to The Lonely Planet guides whenever I visit other places. I haven't checked the one for Iceland but it's probably
@avar
avar / nginx.conf
Last active December 15, 2015 23:59
Non-working example of clobbering credit card numbers in nginx.conf
http {
include mime.types;
log_format main '$remote_addr - $remote_user [$time_local] "$request_munged" '
'$status $body_bytes_sent $request_time/$upstream_response_time '
'"$http_referer" "$http_user_agent"';
[...]
server {
Puppet::Parser::Functions::newfunction(:f_merge_perl_module_list, :type => :rvalue, :doc => "\
De-dupe and merge a module perl module list") do |args|
modules = args[0]
notify("hello there")
return modules
end
@avar
avar / .gitignore
Last active December 12, 2015 10:28
An example of a C# request to a Plack app with Auth::Basic middleware
*.exe
@avar
avar / Util.c
Created February 5, 2013 19:46
Generated content from Taint::Util
/*
* This file was generated automatically by ExtUtils::ParseXS version 2.21 from the
* contents of Util.xs. Do not edit this file, edit Util.xs instead.
*
* ANY CHANGES MADE HERE WILL BE LOST!
*
*/
#line 1 "Util.xs"
#include "EXTERN.h"
@avar
avar / update-hook.pl
Created January 28, 2013 11:05
A hacky little hook to make sure pushed tags contain _tmpl
#!/usr/bin/env perl
use strict;
use warnings FATAL => "all";
# --- Command line
my $refname = $ARGV[0];
my $oldrev = $ARGV[1];
my $newrev = $ARGV[2];
# --- Safety check
@avar
avar / git-training-topics.org
Last active December 11, 2015 05:28
A scratchpad for topics I'm covering in Git training.

-*- org -*-

Git Training

Topics to cover

Remember

Give the audience time to see the command-line fu

Explain stuff before you do it

Use ^SHIFT+L to clear the screen before the next example