Setting up Dokku with DigitalOcean and Namecheap
..or how I made my own heroku in a few hours for $3.98.
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
# For unit testing the application | |
return true if RUBYMOTION_ENV == 'test' | |
# Get the frame for the window | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
# Load all the data from the API |
class EventCell < UITableViewCell | |
IDENTIFIER = 'EventCell' | |
PADDING = 10 | |
LEFT_MARGIN = 40 | |
RIGHT_MARGIN = 20 | |
attr_reader :event | |
def initWithStyle(style, reuseIdentifier: reuse_identifier) | |
super.tap do |cell| |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :authenticate_user! | |
before_filter :restrict_routes! | |
cattr_reader :restrictions | |
def self.allow(kls, *actions) | |
@@restrictions ||= Restrictions.new | |
self.restrictions.add self, kls, actions |
Cette liste est liée au talk "Tout est trop implicite" donné le 25 juin 2013 au OpenCode
@implementation UITextView (RSExtras) | |
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) { | |
/*[s length] is assumed to be 0 or 1. s may be nil. | |
Totally not a strict check.*/ | |
if (s == nil || [s length] < 1) | |
return NO; |
class MyCustomCell < UITableViewCell | |
# This method is used by ProMotion to instantiate cells. | |
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier) | |
super | |
stylish | |
self | |
end | |
# A delegate method when the user clicks the Row(it's blue by default) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Modular DOMReady</title> | |
</head> | |
<body> | |
<header></header> | |
<section role="main"> |
class MyController < UIViewController | |
def viewDidLoad | |
@button = UIButton.alloc.init | |
@button.when_tapped do | |
weak_self = WeakRef.new(self) # <--- create a weak reference to self | |
@alert = UIAlertView.alertViewWithTitle "Alert", | |
message: "Message", | |
cancelButtonTitle: "Dismiss", |
I recently got PATCH mostly working with Backbone and Rails 3, here's what I needed to do.
Sticking Points:
ActiveModel#apply_patch(json_patch)