#!/usr/bin/env ruby | |
PRESUMPTIVE_RAILS_ROOT = "/data/[APP_NAME]/current" | |
LOG_PATH = "/data/[APP_NAME]/shared/log/delayed_job_singleton.log" | |
Dir.chdir PRESUMPTIVE_RAILS_ROOT | |
require 'home_run' | |
require "rubygems" | |
require "bundler/setup" |
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
/* Random Boolean */ | |
var randomNumber = Math.random() >= 0.5; | |
console.log(randomNumber); |
// without callback | |
Array.prototype.eachSlice = function (size){ | |
this.arr = [] | |
for (var i = 0, l = this.length; i < l; i += size){ | |
this.arr.push(this.slice(i, i + size)) | |
} | |
return this.arr | |
}; | |
[1, 2, 3, 4, 5, 6].eachSlice(2) |
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = user and range key = datetime | |
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
exports.handler = function(event, context) { |
Run rails new --help
to view all of the options you can pass to rails new
:
$ bin/rails new --help
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
Updated: Just use qutebrowser (and disable javascript). The web is done for.
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_do_stuff.sh" : | |
mode: "000755" | |
owner: ec2-user | |
group: ec2-user | |
content: | | |
#! /usr/bin/env bash | |
# Using similar syntax as the appdeploy pre hooks that is managed by AWS | |
set -xe |