I hereby claim:
- I am bensie on github.
- I am bensie (https://keybase.io/bensie) on keybase.
- I have a public key whose fingerprint is B720 6EF1 71C0 466C 38BF 65AC C5AB 1889 61E6 14A1
To claim this, I am signing this object:
require "json" | |
module ApiMacros | |
def json(content) | |
JSON.pretty_generate content | |
end | |
def decode_json(content) | |
JSON.parse content, symbolize_names: true |
post "/shots" do | |
if params[:photo] && params[:photo].is_a?(Hash) | |
class UploadedFile < OpenStruct; end | |
paperclip = UploadedFile.new( | |
tempfile: params[:photo][:tempfile], | |
path: params[:photo][:tempfile].path, | |
original_filename: params[:photo][:filename], | |
content_type: params[:photo][:type], | |
head: params[:photo][:head] | |
) |
sudo apt-get install openjdk-7-jre-headless -y | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.2.deb | |
sudo dpkg -i elasticsearch-1.2.2.deb | |
sudo service elasticsearch start |
I hereby claim:
To claim this, I am signing this object:
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
) | |
func uploadHandler(w http.ResponseWriter, r *http.Request) { |
Rails.application.routes.draw do | |
scope module: "api" do | |
constraints subdomain: "api" do | |
match "/", to: "root#options", via: [:options] | |
match "*unmatched", to: "root#options", via: [:options] | |
resource :me, only: [:show, :update], controller: "me" | |
post "/me/access_tokens", to: "access_tokens#create" | |
delete "/me/access_tokens", to: "access_tokens#destroy" |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get autoremove | |
sudo apt-get install build-essential | |
sudo apt-get install mysql-server mysql-client libmysqlclient15-dev libmysql-ruby1.8 ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient16-dev libmysqlclient16 libnet-daemon-perl libopenssl-ruby libopenssl-ruby1.8 libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client mysql-client-5.1 mysql-common mysql-server mysql-server-5.1 rdoc1.8 ri1.8 ruby1.8 ruby1.8-dev zlib1g-dev | |
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby | |
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc |
function validateField(fieldId, alertMessage) { | |
if (document.getElementById(fieldId).value == "") { | |
alert(alertMessage); | |
document.getElementById(fieldId).focus(); | |
return false; | |
} else { | |
return true; | |
} | |
} |
require 'httpclient' | |
module EnomApi | |
def self.included(base) | |
base.send :extend, ClassMethods | |
end | |
module ClassMethods | |
def manage_with_enom | |
send :include, InstanceMethods | |
end |
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |