Skip to content

Instantly share code, notes, and snippets.

View tolland's full-sized avatar

Tom Hodder tolland

View GitHub Profile
@tolland
tolland / ansible-role-test.sh
Last active May 6, 2019 16:38 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
ASCII HTML
Single backticks 'Isn't this fun?' 'Isn't this fun?'
Quotes "Isn't this fun?" "Isn't this fun?"
Dashes -- is en-dash, --- is em-dash -- is en-dash, --- is em-dash
graph LR
A[Square Rect] -- Link text --> B((Circle))

Keybase proof

I hereby claim:

  • I am tolland on github.
  • I am tolland (https://keybase.io/tolland) on keybase.
  • I have a public key ASCtEZi7pS9KU9rBpHew7BAtTtOSmpQuxsTPeSYvhgmeoQo

To claim this, I am signing this object:

@tolland
tolland / Vagrantfile.erb
Created February 19, 2018 00:48
modified Vagrantfile.erb to override the hostname
<% config[:vagrantfiles].each do |vagrantfile| %>
require "<%= vagrantfile %>"
<% end %>
Vagrant.configure("2") do |c|
c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
<% if config[:cachier] %>
if Vagrant.has_plugin?("vagrant-cachier")
c.cache.scope = <%= [':box', ':machine'].include?(config[:cachier]) ? config[:cachier] : ':box' %>
end
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <libpng16/png.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xcomposite.h>
@tolland
tolland / example.c
Last active September 10, 2023 12:22
code to generate png from XGetImage of windows in _NET_CLIENT_LIST
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <libpng16/png.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xcomposite.h>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
public class EventStateManager
{
using System;
using System.Collections;
public class SingletonBase<T> where T : SingletonBase<T>{
}
public class MyChildSingletonA : SingletonBase<MyChildSingletonA> {
}
from android import Android
droid = Android()
def launch_script(path, terminal=False):
terminal = 'FORE' if terminal else 'BACK'
activity = 'com.googlecode.android_scripting.action.LAUNCH_{0}GROUND_SCRIPT'.format(terminal)
extras = {'com.googlecode.android_scripting.extra.SCRIPT_PATH': path}
packagename = 'com.googlecode.android_scripting'
@tolland
tolland / load_embla.m
Last active December 19, 2015 15:08
Octave script for loading *.ebm files produced by Embletta PDS/Remlogic-E devices.
## Copyright (C) 1996-1997 Flaga hf. Medical Devices (authored by Rognvaldur J. Saemundsson)
## Modified by Joris Coppens, 071014, TSD Netherlands institute for Neuroscience
## Copyright (C) 2013 Carnë Draug <carandraug@octave.org>
##
## This program is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation; either version 3 of the License, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT