This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /path/to/app/Dockerfile | |
FROM ruby:2.5-alpine | |
# Set local timezone | |
RUN apk add --update tzdata && \ | |
cp /usr/share/zoneinfo/Europe/London /etc/localtime && \ | |
echo "Europe/London" > /etc/timezone | |
# Install your app's runtime dependencies in the container | |
RUN apk add --update --virtual runtime-deps postgresql-client nodejs libffi-dev readline sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Use this template to report PaperTrail bugs. | |
# Please include only the minimum code necessary to reproduce your issue. | |
require 'bundler/inline' | |
gemfile(true) do | |
ruby '2.5.3' | |
source 'https://rubygems.org' | |
gem 'activerecord', '5.2.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.2' | |
networks: | |
default: | |
external: | |
name: my_net # Needs to be manually created using docker network create | |
services: | |
nginx: | |
image: jwilder/nginx-proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
route "root to: 'posts#index'" | |
generate :scaffold, 'post', 'title:string', 'body:text' | |
file 'config/database.yml', <<-CODE | |
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
host: db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ 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'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductsActivity extends Activity { | |
// ... | |
// onCreate(), etc. | |
// ... | |
/** | |
* Assuming a JSON feed similar to: | |
* { | |
* "products": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.1" | |
defaultConfig { | |
applicationId "com.plymouthsoftware.android.volleyapp" | |
minSdkVersion 8 | |
targetSdkVersion 21 |
NewerOlder