Skip to content

Instantly share code, notes, and snippets.

View tannerburson's full-sized avatar

Tanner Burson tannerburson

View GitHub Profile
@tannerburson
tannerburson / init.vim
Created November 11, 2019 23:28
NeoVim config
"
"Default leader sucks, space makes a lot of things cleaner
"
let mapleader = "\<Space>"
call plug#begin(stdpath('data') . '/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@tannerburson
tannerburson / gist:2820134
Created May 28, 2012 17:12
IntentChooser Plugin Example
IntentChooser.show({
'mime-type': 'text/plain',
'content': 'This is my content: ',
'package-names': ['twitter']
});
@tannerburson
tannerburson / gist:1299388
Created October 19, 2011 19:24 — forked from anonymous/gist:1299378
routing sucks
routing:
resources :listings
match '/p/:secret_code' => 'listings#show', :as => "show_listing"
controller spec:
it "should redirect to the listing show" do
post :create, :listing => @attr
response.should redirect_to(show_listing_path(assigns(:secret_code)))
@tannerburson
tannerburson / proxy.php
Created August 11, 2011 18:49
Stupid lowbrow API proxy
<?php
function cleanup($string) {
$string = strip_tags($string);
$string = preg_replace('/&(quot|apos|lt|gt);/','',$string);
$string = html_entity_decode(htmlspecialchars_decode($string));
return $string;
}
function generate($count){
$nums = array();
Ti.include('underscore.js');
Ti.include('backbone.js');
Ti.include('keystone.js');
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
//
// create controls tab and root window
//
var Status = Backbone.Model.extend({
var Keystone = {};
Keystone.View = Backbone.View;
/** Weird shims to snug BackBone into a DOMLess environment **/
/** Remove DOM specific calls **/
_.each(['tagName','$'],function(param){
delete Keystone.View[param];
});
- (void)loadData {
GetWhateverRequest* req =
[[GetWhateverRequest alloc] initWithUsername:@"username" password:@"password";
[req fetch:self];
}
- (void)restRequestSuccess:(id)results {
NSLog(@"Woot. We're loading shit up!");
/**This particular call returns a hash/associate array/dictionary so let's cast to that **/
results = (NSDictionary*) results;
@implementation GetWhateverRequest
- (id)fetch:(id)object {
[[self class] getPath:@"/path/to/resource" withOptions:nil object:object];
return self;
}
- (id)processResult:(id)resource with:(NSObject<RestRequestDelegate>*)object {
NSLog(@"[API] Returned resource [%@] %@ ",[resource class], resource);
[object restRequestSuccess:resource]; return self;
@interface GetWhateverRequest : RestRequest {
}
- (id)fetch:(id)object;
@end