Skip to content

Instantly share code, notes, and snippets.

View avar's full-sized avatar

Ævar Arnfjörð Bjarmason avar

View GitHub Profile

Þýðing á Git á íslensku

Þetta eru glósur sem varða þýðingu Git á íslensku.

Grunnhugtök

Grunnhugtök í Git eru þessi:

  • The SHA Summa, t.d. "summan er deadbeef"
#!/bin/sh
cd ~/g/perl
git clean -dxf >/dev/null
rm -rf /tmp/perl
echo "Making perl"
./Configure -des -Dprefix=/tmp/perl -Dusedevel >/dev/null
make >/dev/null 2>&1
#!/usr/bin/env perl
# Check if a Tor exit can exit to a given IP/port with TorDNSEL
# Usage, e.g.:
# for exit in $(wget -q -O- "https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$(myip)" | grep -v ^#); do echo $exit; done | perl /tmp/gist-523328/tor-exit-to-ip-port.pl 173.194.37.104 80
use strict;
use warnings;
chomp(my @tor_exits = <STDIN>);
@avar
avar / 30-income-calculon.pl
Last active August 15, 2024 15:13
Calculate your income in The Netherlands with and without a 30% ruling.
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at
@nifgraup
nifgraup / lukrstats.sh
Created December 26, 2011 03:13
statistics on lukr importing, year later.
#/bin/bash
wget --timestamping http://download.geofabrik.de/osm/europe/iceland.osm.pbf
osmosis --read-pbf file=iceland.osm.pbf --way-key-value keyValueList=source.lukr --used-node --write-xml lukr.osm
osmosis --read-xml file=lukr.osm --way-key keyList=highway --used-node --write-xml lukrhighways.osm
xmllint --xpath '/osm/way/@user' lukrhighways.osm | grep -o user=\"[^\"]*\" > users.txt
echo "Skipting þeirra sem síðust breyttu lukr vegum:"
sort users.txt | uniq -c | sort -nr
echo "Fjöldi lukr vega sem búið er að staðfesta: `wc -l users.txt`"
curl -XPUT localhost:9200/test -d '{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}'
curl -XPUT localhost:9200/test/type/1 -d '{
"name" : "Awesometastic 1000",
"type" : "TV Remote"
curl -XPUT localhost:9200/test -d '{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}'
curl -XPUT localhost:9200/test/type/1 -d '{
"name" : "Awesometastic 1000",
"type" : "TV Remote"
@avar
avar / dvorak-qwerty-analyzer.pl
Created March 17, 2012 20:26
Figure out how much of a given piece of text (on stdin) you type where with Dvorak/QWERTY
#!/usr/bin/env perl
use strict;
use Data::Dumper;
use List::Util qw(sum);
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
my $text = do { local $/; scalar <> };
@avar
avar / japan-ideas.md
Created April 10, 2012 10:17
Ideas for things to do in Japan
@avar
avar / CustomizeFatal.pm
Created May 2, 2012 15:46
MooseX::Attribute::TypeConstraint::CustomizeFatal
package MooseX::Attribute::TypeConstraint::CustomizeFatal;
use Moose::Role;
use MooseX::Types::Moose ':all';
use Carp qw(confess);
use MooseX::Types -declare => [ qw(
TypeConstraintCustomizeFatalAction
) ];
use Data::Dumper;
use Try::Tiny;