Skip to content

Instantly share code, notes, and snippets.

@keot
keot / save_experiment.php
Last active December 11, 2015 20:29
Save Experiment Script Saves any HTTP post data sent to the script to a local CSV file. Do NOT use this in production. It's hideously insecure. The directory where the results file is saved requires 'other writeable' (o+w) permissions.
<?php
/* save_experiment.php
* Created by James Mardell <james.mardell@imperial.ac.uk>
* Saves any HTTP post data sent to the script to a local CSV file.
* Do NOT use this in production. It's hideously insecure.
* The directory where the results file is saved requires 'other writeable' (o+w) permissions.
*/
// Configuration
$results_file = 'data.csv';
@keot
keot / mc_blender_render.py
Last active December 12, 2015 02:28
Minecraft Blender parameters for automated rendering of chunks from jMc2Obj.
import bpy, math
object_file = "%%OBJ%%" # complete path
output_file = "%%PNG%%" # use "//filename.ext" for local path
# Clean canvas
for object in bpy.data.objects:
object.select = True
bpy.ops.object.delete()
@keot
keot / pandoc_latex_header.tex
Last active December 15, 2015 02:19
A simple header for Pandoc. Usage: ```pandoc input.md -o output.pdf --include-in-header=pandoc_latex_header.tex```
% Figures and Graphics
\usepackage[format=hang,labelsep=endash,font=small,labelfont=bf]{caption}
% Mathematical Packages
\usepackage{xfrac} % Slanted fractions \sfrac{1}{2}
% Header Packages
\usepackage{lastpage}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
@keot
keot / mkfavicon.sh
Last active December 17, 2015 03:09 — forked from pfig/mkfavicon.sh
Now cleans itself up after conversion.
#!/bin/sh
# originally from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
input=$1
working=`mktemp -d -t mkfavicon-XXXX`
convert $1 -resize 256x256 -filter Gaussian -transparent white ${working}/favicon-256.png
convert ${working}/favicon-256.png -filter Gaussian -resize 16x16 ${working}/favicon-16.png
@keot
keot / mapcutter.cpp
Last active August 29, 2015 14:03
MapCutter: cuts terrain strips into tiles for displaying in a Rapid Serial Visual Presentation (RSVP)
/*
* MapCutter
* Cuts terrain strips into tiles for displaying in a Rapid Serial Visual Presentation (RSVP).
* A component of the Assisting Search and Rescue through Visual Attention thesis appendix.
* http://cas.ee.ic.ac.uk/people/jpm04/asartva/
* Created by James Mardell <james.mardell@imperial.ac.uk> / CC-BY-NC-ND-3.0
*/
#include <iostream>
#include <Magick++.h>
@keot
keot / something.xml
Last active November 30, 2015 16:33
<?xml version="1.0" encoding="UTF-8"?>
<GoogleCustomizations>
<CustomSearchEngine language="en">
<Title>Arachnys</Title>
<Description></Description>
<Context>
<BackgroundLabels>
<?xml version="1.0" encoding="UTF-8"?>
<GoogleCustomizations>
<CustomSearchEngine language="en">
<Title>Arachnys</Title>
<Description></Description>
<Context>
<BackgroundLabels>
<Label name="arachnys" mode="BOOST" />
</BackgroundLabels>
</Context>
<?xml version="1.0" encoding="UTF-8"?>
<GoogleCustomizations>
<CustomSearchEngine language="en">
<Title>Arachnys</Title>
<Description></Description>
<Context>
<BackgroundLabels>
</BackgroundLabels>
</Context>
<schema_org_schemas>Thing</schema_org_schemas>
<?xml version="1.0" encoding="UTF-8"?>
<GoogleCustomizations>
<CustomSearchEngine language="en">
<Title>Arachnys</Title>
<Description></Description>
<Context>
<BackgroundLabels>
<Label name="arachnys" mode="FILTER" top="1000" weight="1.0" />
</BackgroundLabels>
</Context>
<?xml version="1.0" encoding="UTF-8"?>
<GoogleCustomizations>
<CustomSearchEngine language="en">
<Title>Arachnys</Title>
<Description></Description>
<Context>
<BackgroundLabels>
<Label name="arachnys" mode="FILTER" top="1000" />
</BackgroundLabels>
</Context>