This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
"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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IntentChooser.show({ | |
'mime-type': 'text/plain', | |
'content': 'This is my content: ', | |
'package-names': ['twitter'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface GetWhateverRequest : RestRequest { | |
} | |
- (id)fetch:(id)object; | |
@end |
NewerOlder