Skip to content

Instantly share code, notes, and snippets.

View tosbourn's full-sized avatar
🏠
Working from home

Toby Osbourn tosbourn

🏠
Working from home
View GitHub Profile
@tosbourn
tosbourn / kill off port 5000
Created October 22, 2014 08:40
Kill off any process on :5000
lsof -wni tcp:5000 | awk 'NR>1{kill -9 $2}'

Keybase proof

I hereby claim:

  • I am tosbourn on github.
  • I am tosbourn (https://keybase.io/tosbourn) on keybase.
  • I have a public key whose fingerprint is 8ED7 2636 598E 2917 E1CD FF24 5D89 AC71 BEF8 E674

To claim this, I am signing this object:

@tosbourn
tosbourn / Important Firefox Test
Created March 24, 2013 17:12
Some sample code to show off how Firefox treats !important when used with CSS animations
<html>
<head>
<title>Wee Animation Test</title>
<style>
.awesome_but_not_important {
height: 150px;
width: 150px;
background-color: red;
padding: 5px;
-webkit-animation: awesome 5s linear infinite;
@tosbourn
tosbourn / gist:4949176
Created February 13, 2013 22:59
My uber cool gist!
Here is my Gist!
Look at it!
Gisting all over the place
require 'FileUtils'
homepath = File.expand_path "~"
desktop_files = Dir.entries homepath + "/Desktop"
desktop_files.to_a
screen_shot_folder = homepath + "/Desktop/Screenshots"
Dir::mkdir(screen_shot_folder) unless File.exists?(screen_shot_folder)
desktop_files.each {
@tosbourn
tosbourn / bigmysqltables.sql
Created April 25, 2012 09:21
Script to find largest 10 tables your database.
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
@tosbourn
tosbourn / calc.js
Created April 17, 2012 13:52
Quick Calc Function
/**
* Quick calc functionality.
*
* Make sure you pass values of the same metric (all inches, or all centimetres or whatever)
* @input fw int floor width.
* @input fl int floor length.
* @input tw int tile width.
* @input tl int tile length.
*
* @return int Number of tiles.