Skip to content

Instantly share code, notes, and snippets.

View jdbevan's full-sized avatar

Jon Bevan jdbevan

View GitHub Profile
@jdbevan
jdbevan / index.html
Created December 11, 2015 10:12 — forked from dnprock/index.html
World Map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
@jdbevan
jdbevan / speedtest-wrapper.sh
Created November 23, 2015 10:10
Speedtest-cli wrapper
#!/bin/bash -u
WDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
#timeout () {
# SLEEPTIME="$1"
# COMMAND="$2"
# ( cmdpid=$BASHPID; \
# (sleep "$SLEEPTIME"; kill $cmdpid) \
# & exec "$COMMAND" )
@jdbevan
jdbevan / karma.conf.js
Last active August 29, 2015 14:27
jasmine-ajax readyState errors
// Karma configuration
// Generated on Mon Aug 10 2015 17:37:50 GMT+0100 (BST)
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine-ajax','jasmine','jasmine-matchers'],
files: [
'test.js',
'node_modules/jquery/tmp/jquery.js'
@jdbevan
jdbevan / gist:7123ad934da58ab09c49
Last active August 29, 2015 14:13
Frequently used Git commands
# Update knowledge of remote branches
git fetch
# Create a new branch, starting at the existing checkout out point
git checkout -b {some branch name}
# Interactively add unstaged changes to staging
git add -p
# Un-add a file from staging

Keybase proof

I hereby claim:

  • I am jdbevan on github.
  • I am jdbevan (https://keybase.io/jdbevan) on keybase.
  • I have a public key whose fingerprint is 3E5B 28E6 C6C8 DDB0 1DA2 B99D 02BB 58E4 DFB9 6B63

To claim this, I am signing this object:

@jdbevan
jdbevan / FixOrientGetCollection.java
Created August 6, 2014 14:13
OrientDB getCollection() hotfix unit test
package ut.com.jon.test.orient;
import com.orientechnologies.common.parser.OStringParser;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
@jdbevan
jdbevan / escape.php
Last active December 27, 2015 13:49
Proof of concept simple classes for escaping data and accessing SUPERGLOBALS with a little less pain
<?php
class Escape {
public static function forWebpage($data, $flags = ENT_QUOTES, $encoding = 'UTF-8') {
return htmlentities($data, $flags, $encoding);
}
public static function forMySQL($data, $dbcnx) {
return mysql_real_escape_string($data, $dbcnx);
}
public static function forMySQLi($data, $mysqli) {
return $mysqli->real_escape_string($data);