http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
<?php | |
// load JWT class | |
// Class can be found here: https://github.com/firebase/php-jwt | |
include __DIR__.'/JWT.class.php'; | |
$JWT = new JWT(); | |
// Zendesk provides a timestamp in the get. | |
$now = (!empty($_GET['timestamp'])) ? $_GET['timestamp'] : time(); |
function getData() { | |
var deferred = $.Deferred(); | |
$.ajax({ | |
'url': 'http://google.com', | |
'success': function(data) { | |
deferred.resolve('yay'); | |
}, | |
'error': function(error) { | |
deferred.reject('boo'); |
<?php | |
require '../vendor/autoload.php'; | |
require_once 'Config.php'; | |
if(PHP_DEBUG_MODE){ | |
error_reporting(-1); | |
ini_set('display_errors', 'On'); | |
} | |
// authorized user id from db - global var |
<?php | |
class CalendarEvent { | |
/** | |
* | |
* The event ID | |
* @var string | |
*/ | |
private $uid; |
<?php | |
//Using composer to get the Sabre lib | |
require dirname ( __FILE__ ) . '/../vendor/autoload.php'; | |
use Sabre\VObject\Component\VCalendar; | |
// Create a message | |
$message = Swift_Message::newInstance ( 'Message Title' ) | |
->setFrom ( array( '[email protected] ' => 'John Doe' ) ) | |
->setTo ( array( $email ) ) | |
->setSubject ( "Cool message subject" ) |
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
http://guides.rubyonrails.org/migrations.html