Skip to content

Instantly share code, notes, and snippets.

2017/09/27 15:04:52 [INFO] Packer version: 1.0.4
2017/09/27 15:04:52 Packer Target OS/Arch: darwin amd64
2017/09/27 15:04:52 Built with Go Version: go1.8.3
2017/09/27 15:04:52 Detected home directory from env var: /Users/apple-vmhost
2017/09/27 15:04:52 Using internal plugin for amazon-ebsvolume
2017/09/27 15:04:52 Using internal plugin for digitalocean
2017/09/27 15:04:52 Using internal plugin for docker
2017/09/27 15:04:52 Using internal plugin for file
2017/09/27 15:04:52 Using internal plugin for hyperv-iso
2017/09/27 15:04:52 Using internal plugin for oneandone
@spoorcc
spoorcc / main.cpp
Created March 7, 2017 17:06
C++11 tracing utility
#include "trace_util.hpp"
/** To build under gcc:
* g++ main.cpp -stdc=c++11
*/
auto main() -> int
{
TRACE("I would love some %f\n", 3.1415);
ERROR("Some error %d\n", 42);
@spoorcc
spoorcc / main.c
Created January 10, 2017 16:01
Build error string
#include <stdio.h>
struct my_string_t {
uint8_t len;
// char string[];
// const char string[];
char string[128];
// const char * const string;
};
@spoorcc
spoorcc / gist:5fa8434be828d1d189b0
Created March 3, 2016 08:03
JIRA with python: proof-of-concept
#!/usr/bin/env python2
# Use 'pip install jira' to install dependencies
from jira import JIRA, JIRAError
import argparse
MY_JIRA_SERVER = 'https://jira.somewhere.nl:port'
IS_THE_SSL_CERTIFICATE_FIXED = False
def login(username, password):
@spoorcc
spoorcc / euler351.py
Created February 2, 2016 17:14
In progress solution to euler problem 351
#!/usr/bin/env python
def number_of_occlusions(N):
all_points = [x+1 for x in range(N)]
occluded_points = [0 for x in range(N)]
number_of_occlusions = 0
for i in range(1,N/2+1):
delta = i
@spoorcc
spoorcc / GraphIsomorphism.sci
Created December 22, 2015 15:22
SciLab script to check Isomorphism of graphs
funcprot(0);
function plot_graph_matrix(graph)
Matplot((1 - graph) * 255);
endfunction
function sorted_graph = sort_rows(graph)
sorted_graph = gsort(graph, 'lr');
endfunction
function sorted_graph = sort_cols(graph)
@spoorcc
spoorcc / cleartool_graph_log.py
Created December 8, 2015 15:03
Print git log -g for Cleartool
#!/usr/bin/env python
import subprocess
class ParsedLine(object):
def __init__(self, timestamp="", name="", object_type="", comment="", stream="", other_stream=""):
self.timestamp = timestamp
self.name = name
#! /usr/bin/env python
import compiler
from compiler.visitor import ASTVisitor
class Function(object):
def __init__(self, name = None):
self.funcs_to_stub = []
self.decision_paths = 1