Skip to content

Instantly share code, notes, and snippets.

View dhbaird's full-sized avatar

David Baird dhbaird

View GitHub Profile
namespace djson {
// =======
// Classes
// =======
class Number {
double data;
};
@dhbaird
dhbaird / safercurl
Last active August 29, 2015 14:27 — forked from anonymous/safercurl
Safercurl - A python reimplementation of the `curl` command with a twist: command line arguments can be passed in via stdin.
#!/usr/bin/env python
# A python reimplementation of the `curl` command, with a twist: command line
# arguments can be passed in via stdin. This is useful for passing in secret
# tokens that many web APIs require. Rationale: passing secrets via a pipe is
# considered better than passing via command line. It's possible for other
# applications to see the entire command line, secrets and all! Oops! So, don't
# do it!
#
# "Whoami" example with digitalocean:
11 ['libmono-system-security4.0-cil', 'libmono-system4.0-cil', 'libmono-system-configuration4.0-cil', 'libmono-system-xml4.0-cil', 'libmono-corlib4.5-cil', 'mono-r
untime', 'mono-runtime-sgen', 'mono-runtime-common', 'mono-gac', 'mono-4.0-gac', 'libmono-security4.0-cil']
6 ['libgtk-3-0', 'libgtk-3-common', 'adwaita-icon-theme', 'ubuntu-mono', 'humanity-icon-theme', 'libgtk-3-bin']
5 ['libmono-system-web2.0-cil', 'libmono-system-runtime2.0-cil', 'libmono-system-data-linq2.0-cil', 'libmono2.0-cil', 'libmono-wcf3.0a-cil']
3 ['ubuntu-release-upgrader-gtk', 'update-manager', 'update-notifier']
3 ['nova-compute-libvirt', 'nova-compute', 'nova-compute-kvm']
3 ['libverto1', 'libverto-glib1', 'libverto-libevent1']
3 ['libmono-system2.0-cil', 'libmono-security2.0-cil', 'libmono-posix2.0-cil']
3 ['libmono-system-web4.0-cil', 'libmono-system-web-services4.0-cil', 'libmono-web4.0-cil']
3 ['libebook-1.2-16', 'libedata-book-1.2-25', 'evolution-data-server']
==> hello0_bootstrapastbuilder.h <==
#ifndef HELLO0_BOOTSTRAPASTBUILDER_H
#define HELLO0_BOOTSTRAPASTBUILDER_H
namespace hello0 {
class BootstrapAstBuilder {
public:
private:
};
import sys
import json
import yaml
import jinja2
import os
def transform(x):
return x
def main(templateFilename, data):
@dhbaird
dhbaird / Makefile
Created June 21, 2017 13:18
Clang demo
#llvm-config-3.6 --cxxflags
CXXFLAGS += -I/usr/include/llvm-3.6
CXXFLAGS += -I/usr/include/clang/3.6/include
CXXFLAGS += -std=gnu++11
CXXFLAGS += -I/usr/lib/llvm-3.6/include
#CXXFLAGS += -DNDEBUG
CXXFLAGS += -D_GNU_SOURCE
CXXFLAGS += -D__STDC_CONSTANT_MACROS
@dhbaird
dhbaird / yay.yml
Last active February 5, 2018 14:15
- name: yay
hosts: tofu
tasks:
- shell: |
pct create {{ vmid }} {{ ostemplate }} --storage {{ storage }}
args:
creates: /rpool/data/subvol-{{ vmid }}-disk-1
- file: path=/root/staging state=directory
- copy:
src: /etc/pve/lxc/{{ vmid }}.conf
@dhbaird
dhbaird / metarepo.md
Last active July 25, 2018 19:17
Meta repo acceptance
# -*- mode: ruby -*-
# vi: set ft=ruby :
# WARNING:
# THIS SCRIPT DOESN'T WORK.
# wget https://releases.hashicorp.com/vagrant/2.1.2/vagrant_2.1.2_x86_64.deb
# dpkg -i vagrant_2.1.2_x86_64.deb
# vagrant plugin install vagrant-hostmanager
function usage(cmd)
{
return `Usage: ${cmd} [OPTIONS]
OPTIONS
--help Print help.
--server SERVER Name of server to connect to.
EXAMPLES:
Getting help: