Command: heroku pgbackups:capture --remote production
Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712
Command: heroku pgbackups:url [db_key] --remote production
// | |
// UITextField+withFrame.h | |
// | |
#import <Foundation/Foundation.h> | |
@interface UITextField (withFrame) | |
+ (UITextField *)textFieldWithFrame:(CGRect)frame |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
#import <UIKit/UIKit.h> | |
#define IS_IPHONE (!IS_IPAD) | |
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone) | |
/** | |
Provides a few methods to determine what sort of device the application is | |
running on. Specifically, the methods make it easy to determine what sort of | |
iPhone resolution is available: `[[UIApplication sharedApplication] isIphone3]` | |
*/ |
public static class CSV | |
{ | |
public static string ToCSV(this DataTable table) | |
{ | |
var columnHeaders = (from DataColumn x in table.Columns | |
select x.ColumnName).ToArray(); | |
StringBuilder builder = new StringBuilder(String.Join(",", columnHeaders)); | |
builder.Append("\n"); | |
foreach (DataRow row in table.Rows) |
# Export the Heroku PG database to a local dump file | |
# https://devcenter.heroku.com/articles/heroku-postgres-import-export#export | |
heroku pgbackups:capture | |
curl -o latest.dump `heroku pgbackups:url` | |
# Install postregs & Setup password | |
# https://help.ubuntu.com/community/PostgreSQL | |
# List databases | |
sudo -u postgres psql -l |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created | |
return | |
else |
This gist outlines how to resize a view when a keyboard appears using Auto Layout (there are a bunch of code samples out there that manually adjust the view's frame, but that's just so 2013). The method I outline below works universally on both iPhone and iPad, portrait and landscape, and is pretty darn simple.
The first thing to do is to define our containing view controller, the view, and the bottom constraint that we'll use to adjust its size.
Here's HeightAdjustingViewController.h. We don't need to expose any public properties, so it's pretty bare.
#!/bin/sh | |
# | |
# chkconfig: 2345 55 25 | |
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx | |
# For Debian, run: update-rc.d -f nginx defaults | |
# For CentOS, run: chkconfig --add nginx | |
# | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all |