Note, please replace "WWW/tools" with where ever you store your web tools.
$ mkdir ~/WWW/tools
$ cd ~/WWW/tools
$ git clone https://github.com/phacility/libphutil.git
$ git clone https://github.com/phacility/arcanist.git
const fs = require('fs') | |
const DynamoDB = require('aws-sdk/clients/dynamodb') | |
const yaml = require('js-yaml') | |
const cloudformationSchema = require('@serverless/utils/cloudformation-schema') | |
const SERVERLESS_CONFIG = __dirname + '/serverless.yml' | |
const ddb = new DynamoDB({ | |
accessKeyId: 'fake-key', | |
endpoint: 'http://localhost:8001', |
# Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/ | |
$ sudo apt-get update | |
$ sudo apt-get dist-upgrade | |
$ wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz | |
$ tar -xvzf openssl-1.0.2h.tar.gz | |
$ cd openssl-1.0.2h | |
$ ./config --prefix=/usr/ | |
$ make depend |
sudo apt-get update | |
sudo apt-get install build-essential checkinstall libx11-dev libxext-dev zlib1g-dev libpng12-dev libjpeg-dev libfreetype6-dev libxml2-dev | |
sudo apt-get install imagemagick | |
wget http://www.imagemagick.org/download/ImageMagick.tar.gz | |
tar -xzvf ImageMagick.tar.gz | |
cd ImageMagick-6.8.9-9 | |
./configure | |
make | |
sudo make install |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
diff --git a/Gemfile b/Gemfile | |
index ee62ec2..0ace91f 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -1,9 +1,9 @@ | |
-source 'http://rubygems.org' | |
+source 'https://rubygems.org' | |
-gem 'rails', '3.1.4' | |
+gem 'rails', '3.2.6' |
#MySQL Client | |
ln -s /Applications/MySQLWorkbench.app/Contents/Resources/mysql /usr/bin/mysql | |
#MySQL Dump | |
ln -s /Applications/MySQLWorkbench.app/Contents/Resources/mysqldump /usr/bin/mysqldump | |
#How to fix the "Library not loaded: libmysqlclient.18.dylib (LoadError)" error | |
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib |
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |