Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
JoshCheek / spotify_remote_control.rb
Last active November 21, 2016 07:02
Command Line spotify remote-control (a working example for https://github.com/spotify/web-api/issues/15)
require 'io/console'
require 'open3'
require 'pp'
begin
require 'coderay'
rescue LoadError # might not already have syntax highlighting
end
class App
@kaiix
kaiix / gist:4070967
Created November 14, 2012 08:20
Add dotted/dashed border to a UITableViewCell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (!cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
}
@swizzlevixen
swizzlevixen / gist:1889278
Created February 23, 2012 02:21
Call Objective-C methods from UIWebView, with optional argument
//
// by Mark Boszko
//
// Expanded from code by DAMIEN LE BERRIGAUD
// http://meliondesign.blogspot.com/2010/02/mapping-uiwebview-links-to.html
//
//
// Sample code to return a method call,
// with or without argument, from UIWebView
// links with format:
@timnovinger
timnovinger / bodyid.rb
Created October 14, 2009 13:37
Automatic Body ID in Rails
###############################################
# place in /app/helpers/application_helper.rb #
###############################################
def bodytag_id
a = controller.class.to_s.underscore.gsub(/_controller$/, '')
b = controller.action_name.underscore
"#{a}-#{b}".gsub(/_/, '-')
end