View rails-docker-pg-template.rb
generate(:scaffold, "post", "title:string", "body:text")
route "root to: 'posts#index'"
file 'config/database.yml', <<-CODE
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: db
View gulpfile.js
// $ npm install
// $ gulp serve
// $ open http://localhost:8080
var gulp = require('gulp'),
del = require('del'),
scss = require('gulp-sass'),
htmlmin = require('gulp-htmlmin'),
cleancss = require('gulp-clean-css'),
connect = require('gulp-connect'),
View model.rb
class Model < ActiveRecord::Base
include UuidConcern
# uuid attribute is `:uuid` by default. Optionally pass in attribute name, e.g `has_uuid :unique_token`
has_uuid
end
View custom.json
{
"message": "JSON Response OK",
"code": 200,
"images": [
{
"url": "http://assets.chrisblunt.com/wp-content/uploads/2012/12/IMG_20120619_202506-e1356946615784.jpg",
"title": "Hand Sunset"
},
{
"url": "http://assets.chrisblunt.com/wp-content/uploads/2010/01/PC280118.jpg",
View MainActivity.java
class MainActivity extends Activity {
// mEntries in this case is just an ArrayList store
private ArrayList<String> mEntries;
// ...
// Fetch method
private void fetch(RequestQueue requestQueue) {
JsonArrayRequest request = new JsonArrayRequest("http://example.com/feed.json",
new Response.Listener<JSONArray>() {
View ProductsActivity.java
public class ProductsActivity extends Activity {
// ...
// onCreate(), etc.
// ...
/**
* Assuming a JSON feed similar to:
* {
* "products": [
View build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.plymouthsoftware.android.volleyapp"
minSdkVersion 8
targetSdkVersion 21
View cloudfiles-copy.rb
require 'rubygems'
require 'fog'
# Configuration
CONTAINER_NAME = "your_container_name"
IGNORE_TYPES = ["application/directory"]
MAX_TRIES = 3
CF_USERNAME = "your_rackspace_username"
CF_API_KEY = "your_rackspace_api_key"
View hash_rocket_replace.rb
# Simple regex to replace ruby rocket-syntax hash keys with JSON style.
# e.g. Replace :some_key => "value" with some_key: "value"
#
# (Tested in sublime)
/:([a-zA-Z0-9_-]*)(( *)=>\ *)/$1: /
View README.md

Description

A simple Dashing job to display the total value of open/overdue invoices from FreeAgent.

Dependencies

An app id/secret and access token setup via FreeAgent Developer.

Freeagent Api Gem

Add it to dashing's gemfile: