create linode server instance
local:
<shell>$ssh root@(IP ADDRESS)
remote:
from django.contrib.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |
From: Chris DeSalvo <[email protected]> | |
Subject: Why we can't process Emoji anymore | |
Date: Thu, 12 Jan 2012 18:49:20 -0800 | |
Message-Id: <[email protected]> | |
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B | |
Content-Transfer-Encoding: quoted-printable | |
Content-Type: text/plain; | |
charset=utf-8 |
#!/bin/bash | |
# | |
# Ruby 1.9.2 with options for database, and nginx install. Adds option to install RVM system-wide. | |
# Outputs to /root/stackscript.log | |
# | |
# <UDF name="deploy_user" Label="Name of deployment user." /> | |
# <UDF name="deploy_password" Label="Password for deployment user." /> | |
# <UDF name="deploy_sshkey" Label="Deployment user public ssh key." /> | |
# <UDF name="ssh_port" Label="SSH Port" /> | |
# <UDF name="new_hostname" Label="Server's hostname." /> |
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
alert = UIAlertView.new | |
alert.message = t('start') | |
alert.show | |
true | |
end | |
def t(key) | |
NSBundle.mainBundle.localizedStringForKey(key, value:nil, table:nil) |
class AppDelegate | |
attr_accessor :window | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
self.window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
window.rootViewController = Controller.alloc.init | |
window.rootViewController.wantsFullScreenLayout = true | |
window.makeKeyAndVisible | |
true | |
end | |
end |
Confirming the theory that at some point most speakers drop out of the circuit and become less visible :)
class SaveCancelToolbar < UIToolbar | |
attr_writer :delegate | |
def initWithFrame frame, andTitle: title | |
super | |
items = [] | |
spacer = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:nil, action:nil) | |
@cancel_button = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemCancel, target:self, action:'on_cancel:') |
class MyViewController < UIViewController | |
include ViewTags | |
#by convention, these views will have tags that correspond to the order you specify them in | |
# :date_label:1, :name_label:2 | |
has_view :date_label, :name_label | |
def loadView | |
views = NSBundle.mainBundle.loadNibNamed "myview", owner:self, options:nil | |
self.view = views[0] |