Skip to content

Instantly share code, notes, and snippets.

@teddywing
teddywing / gist:2331663
Created April 7, 2012 19:52
Barcamp Boston 7 Notes
@teddywing
teddywing / gist:7189214
Created October 27, 2013 23:32
BarCamp Boston 8 Notes

BarCamp Boston 8 - October 2013

Saturday 2013.10.26

Data Visualisation

Can visualise data in terms of different methods of organisation

  • Alphabetical
  • Time
@teddywing
teddywing / gist:299564b5e106c5913871
Created June 13, 2014 00:30
OpenTok API v1 accessDenied event handler example
<html>
<head>
<meta charset="utf-8">
<title>Opentok Quick Start</title>
<script src="//static.opentok.com/v1.1/js/TB.min.js"></script>
<script>
// Initialize API key, session, and token...
// Think of a session as a room, and a token as the key to get in to the room
// Sessions and tokens are generated on your server and passed down to the client
var api_key = "YOUR API KEY";
#!/usr/bin/env sh
if [ $# == 0 ]; then
MYSQL_USERNAME=''
MYSQL_DATABASE=''
elif [ $# != 2 ]; then
echo "Usage: $0 <mysql username> <mysql database name>" 1>&2
exit 1
fi
@teddywing
teddywing / prepare-commit-msg
Last active July 6, 2019 13:58
Uncomment “Conflicts:” section in git merge commits
#!/bin/sh
case "$2,$3" in
merge,)
/usr/bin/perl -i.bak -ne 's/^# //, s/^#\t/\t/ if /^# Conflicts/ .. /^$/; print' "$1" ;;
*) ;;
esac
@teddywing
teddywing / robot_circle.py
Last active September 3, 2015 06:05
Robot movement
#!/usr/bin/env python
class Point(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __repr__(self):
@teddywing
teddywing / install.sh
Last active May 2, 2017 09:52
Git hook that adds "Refs #[issue number]" to commit messages
cd project/
cp -i prepare-commit-msg .git/hooks/
chmod +x .git/hooks/prepare-commit-msg
@teddywing
teddywing / space-to-hyphen.bash
Last active November 11, 2017 20:41
Toggle spacebar to output " " or "-" (for writing Git branch names)
# Copyright © 2017 Teddy Wing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@teddywing
teddywing / hstore_accessor-integer-cast-research.txt
Last active November 14, 2017 22:29
Research into a bug with the `hstore_accessor` Ruby gem, where it typecasts before performing validations
Enquête hstore_accessor
La gem s'intègre avec `ActiveRecord` dans :
https://github.com/devmynd/hstore_accessor/blob/v1.1.0/lib/hstore_accessor.rb
Quand on appele `hstore_accessor` dans un modèle, la méthode dans
https://github.com/devmynd/hstore_accessor/blob/v1.1.0/lib/hstore_accessor/macro.rb
est executé.
Une module est créée qui définit des méthodes inclus dans le modèle :
@teddywing
teddywing / Cargo.toml
Last active October 31, 2018 16:52
Rust Combine error propagation
[package]
name = "parser-error-test"
version = "0.1.0"
[dependencies]
combine = "3.6.1"