Skip to content

Instantly share code, notes, and snippets.

View toastdriven's full-sized avatar

Daniel Lindsley toastdriven

View GitHub Profile

Keybase proof

I hereby claim:

  • I am toastdriven on github.
  • I am daniellindsley (https://keybase.io/daniellindsley) on keybase.
  • I have a public key whose fingerprint is 96D8 9667 409F BAD8 F716 690D 554A 1A3D B0B6 CFFE

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from boto.s3 import S3RegionInfo
from boto.s3.connection import S3Connection
import redis
class CachedS3Connection(S3Connection):
cache_conn = redis.StrictRedis()
def get_all_buckets(self, headers=None):
if self.cache_conn.exists('all_buckets'):
import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet var window: NSWindow
func applicationDidFinishLaunching(aNotification: NSNotification?) {
var frame = NSMakeRect(0, 0, 200, 200)
var window = NSWindow(contentRect:frame, styleMask:NSBorderlessWindowMask, backing:NSBackingStoreType.Buffered, defer:false)
// This doesn't seem to have an effect. :/
//
// ViewController.swift
// TestUI
//
// Created by Daniel on 6/5/14.
// Copyright (c) 2014 Daniel. All rights reserved.
//
import Foundation
import UIKit
@toastdriven
toastdriven / import_order.py
Created June 18, 2014 17:43
My preferred import ordering/style for Python code.
# Python *built-ins*
import datetime
import os
import time
# Pip-installed *Python* libraries
import boto
import requests
# Django *built-ins*
from django.shortcuts import redirect, render
def my_view(request):
if request.method == 'POST':
form = MyForm(request.POST)
if form.is_valid():
# Save some data then...
return redirect('view-name-here', kwargs_go=here)
@toastdriven
toastdriven / elite_keybinds.rst
Created January 29, 2015 21:54
Because I have an Elite: Dangerous problem...

Elite Keybinds

Stick

  • Hat: Thrusters (+ UI Panel nav?)
  • Trigger: Primary Fire (Discovery Scanner)
  • 2 (L1): Secondary Fire
  • 3 (R3): Select Target
package main
import (
"container/list"
"fmt"
"time"
)
func main() {
l := list.New()