Skip to content

Instantly share code, notes, and snippets.

View pmorch's full-sized avatar

Peter Valdemar Mørch pmorch

View GitHub Profile
@pmorch
pmorch / data.xml
Last active December 9, 2016 15:14
Excel XML Import problems with Regional Format Danish
<?xml version="1.0" encoding="iso-8859-1"?>
<statistics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
<record>
<name>name</name>
<value>123.45</value>
</record>
</statistics>
@pmorch
pmorch / README.txt
Last active August 29, 2015 14:28
nmap seems to sometimes omit results for no apparent reason...
These are the details for a posting to the dev@nmap.org mailing list titled:
"Bug report? nmap seems to sometimes omit results for no apparent reason..."
http://permalink.gmane.org/gmane.comp.security.nmap.devel/28784
@pmorch
pmorch / developement_jessie_fail.log
Created November 20, 2014 15:01
bootstrap-vz: Can't build jessie in either master or development
root@ip-10-0-0-93:~/bootstrap-vz# AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXX AWS_SECRET_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY ./bootstrap-vz manifests/ec2-ebs-debian-testing-amd64-pvm.manifest.yml
Getting AWS credentials
Adding commands required for formatting
Retrieving instance metadata
Adding locale package to bootstrap installation
Adding commands required for bootstrapping Debian
Creating workspace
Determining required external commands for EC2 bootstrapping
Connecting to EC2
Determining the AMI name
@pmorch
pmorch / manifest.diff
Created November 20, 2014 14:42
bootstrap-vz: Development branch: Inline Credentials - directly in manifest files - don't work
root@ip-10-0-0-195:~/bootstrap-vz# git diff
diff --git a/manifests/ec2-ebs-debian-official-amd64-hvm.manifest.yml b/manifests/ec2-ebs-debian-official-amd64-hvm.manifest.yml
index ed10508..2dd77e9 100644
--- a/manifests/ec2-ebs-debian-official-amd64-hvm.manifest.yml
+++ b/manifests/ec2-ebs-debian-official-amd64-hvm.manifest.yml
@@ -3,8 +3,8 @@ provider:
name: ec2
virtualization: hvm
# credentials:
- # access-key: AFAKEACCESSKEYFORAWS

Now I've just spent 2 days using DataTables in my AngularJS project.

For me, the important part of the DataTables / AngularJS integration is being able to do it "the angular way". Which means, that the $scope has all the data, but just the data, and the presentation lies in the templates that create the DOM.

To give an idea, here is what the final result looks like: Imgur So in each table cell, there are all kinds of markup. For now, lets pretend it is a <ul> with <li>s containing links just for the sake of argument.

Because I'm using the

@pmorch
pmorch / diffs.txt
Created February 26, 2013 15:20
Diffs in Net--RabbitMQ's rabbitmq-c since the beginning of time until commit 3f5b1892e665a820573abf8fae896096d828a15f
diff -u librabbitmq//amqp_api.c ./amqp_api.c
--- librabbitmq//amqp_api.c 2009-11-12 21:15:45.000000000 +0100
+++ ./amqp_api.c 2013-02-26 09:57:11.000000000 +0100
@@ -4,23 +4,32 @@
#include <stdint.h>
#include <errno.h>
+#include <config.h> /* Perl's CORE config */
+#ifndef USE_ITHREADS
+#define DISABLE_THREADS
@pmorch
pmorch / bitcount.c
Created November 9, 2012 10:04
Question: How to counting bits in many integers fast?
/*
I was asked: Given 10,000 16-bit integers and unlimited RAM, how would you
fastest count the number of bits in each integer?
I answered that the fastest would be to create a table with 2^16 entries
and pre-populate it with the bit counts, and then for each integer just do
a lookup in that table.
The response I got was that it was faster to create a smaller table, 4 bits
@pmorch
pmorch / unexpectedDestroySequence.pl
Created July 11, 2012 07:03
perl: DESTROY called in unexpected sequence
#!/usr/bin/perl
use strict;
use warnings;
=head1 DESTROY called in unexpected sequence
See http://stackoverflow.com/questions/11427281/destroy-called-in-unexpected-sequence
for discussion.
I started out noticing something odd about "Scope::Guard". If I undef
@pmorch
pmorch / README.md
Created February 1, 2012 08:17
Working bugfix for "ThemeRoller Bookmarklet not working" http://bugs.jqueryui.com/ticket/7195
@pmorch
pmorch / HelloWorld.class
Created January 16, 2012 15:11
OpenJDK goes 100%