Skip to content

Instantly share code, notes, and snippets.

View nickcharlton's full-sized avatar
🐢
I'm swamped at the moment and will respond when I can!

Nick Charlton nickcharlton

🐢
I'm swamped at the moment and will respond when I can!
View GitHub Profile
@nickcharlton
nickcharlton / gist:3360261
Created August 15, 2012 13:41
Maker Faire Bios

Maker Faire Bios

Exhibit Abstract (50-100 words max.)

Have you ever thought about being able to print objects as you would documents? So did we. 3D Printers seem to be taking the Maker world by storm, and we have some with us.

So, come and see some 3D printers in action. We'll have a group of RepRaps printing whistles that you can take away all day. Get there in the morning, and you can have your initials printed on one for free!

(74 words.)

server {
server_name *.example.com;
access_log log/access.log;
error_log log/error.log error;
root /var/www/apps/simple;
}
@nickcharlton
nickcharlton / gist:5373826
Created April 12, 2013 17:51
A Python iterable that returns one of two member variables.
class Vector():
def __init__(self, x, y):
self.x = x
self.y = y
self.index = 0
def __iter__(self):
return self
def next(self):
@nickcharlton
nickcharlton / seek.py
Created April 18, 2013 10:50
This is the Seek example from The Nature of Code reimplemented with a custom Vector class (also included) and done in Python with Pygame.
import sys
from vector import Vector
import pygame
import pygame.gfxdraw
class Vehicle():
def __init__(self, x, y):
self.location = Vector(x, y)
self.velocity = Vector(0, 0)
@nickcharlton
nickcharlton / person.rb
Created June 25, 2013 21:34
Simple Person Object Spec (MiniTest, Ruby 2.0)
class Person
attr_reader :first_name, :last_name
def initialize(first_name, last_name)
@first_name = first_name
@last_name = last_name
end
def full_name
"#{first_name} #{last_name}"
@nickcharlton
nickcharlton / gist:6009387
Created July 16, 2013 14:45
This is from where I moved from /post/post-name/ to /posts/post-name.html. And the same for /projects/ to /projects.html and so on.
<Directory "/var/www/site">
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^post/(.*) http://nickcharlton.net/posts/$1.html [NC]
RewriteRule ^projects$ http://nickcharlton.net/projects.html [NC]
RewriteRule ^about$ http://nickcharlton.net/about.html [NC]
RewriteRule ^archives$ http://nickcharlton.net/archives.html [NC]
</Directory>
import sys
import apt_pkg
# init apt and config
apt_pkg.init()
# open the apt cache
try:
cache = apt_pkg.Cache()
except SystemError, e:
@nickcharlton
nickcharlton / daily_obs_csv.py
Created August 14, 2013 17:40
This is a quick example to show how you could parse the hourly observation data from the Met Office DataPoint API and turn it into a CSV file. The code isn't very good as I threw this together in about an hour. An example CSV file is included.
#!/usr/bin/python
"""
Assemble a CSV file from the Hourly Observation Service from the Met Office
DataPoint API.
This is a bit of a mess – it was hacked together quickly to give an example of how
you could go about having a CSV file of observation data. It does an API request,
parses the data as JSON, then turns that into a set of data model objects, those
are them flattened and written down as a CSV file.
@nickcharlton
nickcharlton / precise64_stderr.log
Last active December 21, 2015 05:39
Standard and Debug output from Packer, for https://github.com/mitchellh/packer/issues/303. Run with OS X Firewall enabled, but none other than the default builder firewall exception.
2013/08/17 19:38:43 Packer Version: 0.3.1
2013/08/17 19:38:43 Packer Target OS/Arch: darwin amd64
2013/08/17 19:38:43 Detected home directory from env var: /Users/nickcharlton
2013/08/17 19:38:43 Attempting to open config file: /Users/nickcharlton/.packerconfig
2013/08/17 19:38:43 File doesn't exist, but doesn't need to. Ignoring.
2013/08/17 19:38:43 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build fix:packer-command-fix validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant] Provisioners:map[file:packer-provisioner-file shell:packer-provisioner-shell salt-masterless:packer-provisioner-salt-masterless]}
2013/08/17 19:38:43 Setting cache directory: /Users/nickcharlton/Dropbox/Projects/boxes
@nickcharlton
nickcharlton / README.md
Last active December 21, 2015 14:28
A collection of archived VMs provisioned like the default Vagrantboxes – but newer.

So, I've been assembling a set of scripts to build Vagrant boxes. The intial idea was to build updated, reasonably well documented versions of the ones which already exist, from which I can then reuse to build more complex boxes.

Eventually, this will be a project called [boxes][]. But for now, here are some of the outputs from what I've been working on. I'm working on adding Debian (stable, unstable) and the current and LTS version of Ubuntu. It's just the current Ubuntu LTS right now.

The eventual idea is to have the box building scripts run through some sort of CI server so that it's automatically rebuilt and tested. I haven't got here yet, but that's why the boxes have no timestamps — the links should work forever.