Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Node-Link Tree</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.27.2"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.27.2"></script>
<style>
@KJTsanaktsidis
KJTsanaktsidis / graph.py
Created May 11, 2013 04:40
A graph that can do dijkstra's algorithm and a little extra
import csv
import functools
import sys
import heapq
class AdjacencyGraph():
@functools.total_ordering
class SearchNode():
--Implements Mergesort
mergeLists :: (Ord a) => [a] -> [a] -> [a] -> [a]
mergeLists acc xa xb
| null xa && null xb = acc --We are complete
| null xa = mergeLists (acc:(head xb)) [] (tail xb) --Only b left
| null xb = mergeLists (acc:(head xa)) (tail xa) [] --Only a left
| (head xa) <= (head xb) = mergeLists (acc:(head xa)) (tail xa) xb --a first
| otherwise = mergeLists (acc:(head xb)) xa (tail xb) --b first
--Implements Mergesort
mergeLists :: (Ord a) => [a] -> [a] -> [a] -> [a]
mergeLists acc xa xb
| null xa && null xb = reverse acc --We are complete
| null xa = mergeLists ((head xb):acc) [] (tail xb) --Only b left
| null xb = mergeLists ((head xa):acc) (tail xa) [] --Only a left
| (head xa) <= (head xb) = mergeLists ((head xa):acc) (tail xa) xb --a first
| otherwise = mergeLists ((head xb):acc) xa (tail xb) --b first
<!doctype html>
<html>
<head>
<!-- Copied from: http://fastclick-issue83.aws.af.cm/ -->
<title>Fastclick test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type='application/javascript' src='../lib/fastclick.js'></script>
<script>
window.addEventListener('load', function() {
new FastClick(document.body);
#ifndef gcd_test_test_webserver_h
#define gcd_test_test_webserver_h
@interface TestWebserver : NSObject
-(TestWebserver*)init;
-(void) start;
-(void) stop;
@end
@KJTsanaktsidis
KJTsanaktsidis / GCDWebServerAsyncPushResponse.h
Created February 26, 2015 22:53
GCDWebServerAsyncPushResponse
#import "GCDWebServerResponse.h"
#ifndef mobile_app_2_GCDWebServerAsyncPushResponse_h
#define mobile_app_2_GCDWebServerAsyncPushResponse_h
/**
* This response type lets you push data into it asynchronously
* and have it end up on the connection, as opposed to GCDWebServerStreamedResponse
* which requires you to provide data when asked
*/
@KJTsanaktsidis
KJTsanaktsidis / votes
Last active June 27, 2016 04:09
Accepting pull requests!
HINCH,Derryn
MUIR,Ricky
GRIMLEY,Stuart
MADIGAN,John
LEHRER,Danielle
MILNE,Stuart
GEORGE,Mark
ISHERWOOD,Craig
PEUT,Gabrielle
SINNEMA,Chris
@KJTsanaktsidis
KJTsanaktsidis / aws_shell.py
Created November 15, 2017 00:02
Python script to load temporary credentials for 2FA
#!/usr/bin/env python
# EB CLI doesn't support assuming roles like the AWS CLI does. This script is a workaround that requests
# temporary credentials, then exports them to the environment for packer to use.
# It then shares the AMI to the dev / prod accounts (from the cooporate account)
import ConfigParser
from os.path import expanduser
import boto3
import boto3.session
@KJTsanaktsidis
KJTsanaktsidis / keybase.md
Created November 30, 2017 22:55
keybase.md

Keybase proof

I hereby claim:

  • I am kjtsanaktsidis on github.
  • I am kjtsanaktsidis (https://keybase.io/kjtsanaktsidis) on keybase.
  • I have a public key ASDpvPCh8bABruP2-jAUUQ4f-c96Je8dXrQfPn8zduVW1go

To claim this, I am signing this object: