View triangle.cr
module Radians
class Triangle
lib C
# In C: double cos(double x)
fun cos(value : Float64) : Float64
end
def cos(value : Float64)
C.cos(value)
end
View nested_mass_assignment.rb
module NestedMassAssignment
extend ActiveSupport::Concern
included do
include ActiveAttr::BasicModel
include ActiveAttr::BlockInitialization
include ActiveAttr::Logger
# include ActiveAttr::MassAssignment
include ActiveAttr::AttributeDefaults
include ActiveAttr::QueryAttributes
View decode_session_cookie.rb
View form.html.eex
<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<p> Something is broken. Check the following: </p>
<ul>
<%= for {attr, message} <- f.errors do %>
<li>
<%= humanize(attr) %>
&nbsp;
<%= message %>
</li>
View e-commerce.md

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

View build.sh
#!/bin/bash
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
PROJECT_NAME=""
TARGET_SDK="iphoneos"
APPLICATION_NAME=""
DEVELOPER_NAME="iPhone Distribution: blahblah."
PROVISIONING_PROFILE="ProductionPush_10_10.mobileprovision"
TIME_STAMP="$(date +%m/%d/%y) $(date +%r)"