Skip to content

Instantly share code, notes, and snippets.

View andypols's full-sized avatar

Andy Pols andypols

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andypols
andypols / flight-trajectory.json
Last active November 19, 2021 18:31
flight-trajectory.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andypols
andypols / abersoch-to-talybont.json
Last active November 12, 2021 16:36
Abersoch to Talybont
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andypols
andypols / london-to-bright.json
Created November 12, 2021 11:20
GeoJson for straight line from London to Brighton
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import junit.framework.TestCase;
import java.text.DecimalFormat;
import java.text.ParseException;
public class StrangeNumberTest extends TestCase {
public void testWierdJavaNumber() throws ParseException {
DecimalFormat format = new DecimalFormat("##,###.00");
assertEquals("Amazing, but true",
10,
(Long) format.parse("10WTF?"), 0);
@andypols
andypols / table-migrate.py
Created August 1, 2019 11:32
Python script to migrate a dynamo DB table from one AWS account to another
import boto3
table_name = 'vinterest-test'
source = boto3.resource('dynamodb',
aws_access_key_id='<TODO>',
aws_secret_access_key='<TODO>'
)
source_table = source.Table(table_name)

Keybase proof

I hereby claim:

  • I am andypols on github.
  • I am andypols (https://keybase.io/andypols) on keybase.
  • I have a public key whose fingerprint is 63A0 AC7C 8935 872E AEFC D0A3 5DFD 8A06 60DE 3D30

To claim this, I am signing this object:

@andypols
andypols / ntlm.js
Created May 3, 2013 19:37
Javascript to create the type1, type3 messages you need to communicate with an ntlm server. I used this to talk to a NTLM enabled windows server from a node.js application.
var url = require('url');
var crypto = require('crypto');
/*
NTLM PROCESS FOR GET REQUESTS:
==============================
STEP 1: The Client requests a protected resource from the server
STEP 2: The Server responds with a 401 status, with a header indicating that the client must authenticate
STEP 3: The Client resubmits the request with an Authorization header containing a Base-64 encoded Type 1 message. From this point forward, the connection is kept open; closing the connection requires reauthentication of subsequent requests.