Skip to content

Instantly share code, notes, and snippets.

View ptim's full-sized avatar

Tim Osborn ptim

View GitHub Profile
@ptim
ptim / SaveAs-UTF8.py
Created March 12, 2014 11:59
ST3 super simple plugin: Save the current file with encoding UTF8, then close.
import sublime, sublime_plugin
'''
A response to: http://stackoverflow.com/questions/19831757/how-to-create-macro-in-sublime-text-3-with-saveas-and-close-file-command
Save the current file with encoding UTF8, then close.
To trigger the command with 'Command Option Shift 8',
add the following to your Sublime Text > Preferences > Keybindings - User
@ptim
ptim / ST3-paste-path.py
Last active August 29, 2015 13:57
ST3: Paste the current file's Relative Path From Project (Encoded). Requires https://github.com/titoBouzout/SideBarEnhancements be installed
import sublime, sublime_plugin
'''
Paste the current file's Relative Path From Project (Encoded).
Requires https://github.com/titoBouzout/SideBarEnhancements to be installed
First save this file as:
~/Library/Application Support/Sublime Text 3/Packages/User/paste-path.py
More details about writing plugins: http://docs.sublimetext.info/en/latest/reference/plugins.html
@ptim
ptim / updateip.py
Last active August 29, 2015 14:07 — forked from hamsolodev/updateip.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Update Route53 DNS A name record for home IP.
#
# Uses the *route53* library, rather than boto.
from __future__ import print_function
import os
import re
@ptim
ptim / index.html
Last active September 25, 2015 04:44
Sheetsu and d3.js
<!DOCTYPE html>
<html>
<head>
<title>D3 Sheetsu</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
* {
box-sizing: border-box;
}
body {
@ptim
ptim / readme.md
Last active September 13, 2022 13:09
Browsersync.io 'alias'

This handy 'alias' is actually a bash function allowing you to run bs from the directory you want to serve, giving you a dev server, with live reload, directory indexes, and the goodness of sync'd scrolling across multiple devices!

It prints out the command that's run and a link to the docs so that I don't completely forget what I'm actually doing!

bs() {
    echo
    echo "browser-sync start --server --directory --files \"**\""
    echo "http://www.browsersync.io/docs/command-line/"
    echo

browser-sync start --server --directory --files "**"

@ptim
ptim / .pdbrc
Last active April 27, 2023 18:44 — forked from reebalazs/.pdbrc
.pdbrc working with ipdb and PdbSublimeTextSupport
# http://stackoverflow.com/questions/12723375/python-line-highlight-on-sublime-text-2-from-ipdb
import pdb
from PdbSublimeTextSupport import preloop, precmd
pdb.Pdb.preloop = preloop
pdb.Pdb.precmd = precmd
try:
from ipdb.__main__ import Pdb as ipdb_Pdb
except ImportError:

Keybase proof

I hereby claim:

  • I am ptim on github.
  • I am ptim (https://keybase.io/ptim) on keybase.
  • I have a public key whose fingerprint is 8E20 8EE9 592E 7398 4BFD 353A A23A 0AB9 2D63 AE7E

To claim this, I am signing this object:

@ptim
ptim / esnextbin.md
Last active December 14, 2016 12:52
esnextbin sketch
@ptim
ptim / CSS-structure.md
Created August 3, 2018 00:49
Links from a discussion held during the Melb Django Peer to Peer Learning Night on 2018-08-02 at Commoncode
@ptim
ptim / airbus_data.tsv
Created December 3, 2019 12:54 — forked from atmccann/airbus_data.tsv
Animated path multi-series line chart
date Airbus Boeing
2000-07-31 0 0
2000-08-31 -0.884 9.8912
2000-09-29 9.6685 32.1383
2000-10-31 32.5967 38.9245
2000-11-30 33.1492 41.4853
2000-12-29 30.7182 35.2113
2001-01-31 27.0718 19.8464
2001-02-28 24.3094 27.4264
2001-03-30 16.0773 14.1306