This setup guide was created with the following components:
- DigitalOcean Droplet (Ubuntu 16.04.4 x64)
- Postgresql 9.5
- Nginx + Passenger
- Rails 5.2
- Ruby 2.4.1
before_script: | |
- apt-get update -qq | |
- apt-get install -qq git | |
## | |
## Install ssh-agent if not already installed, it is required by Docker. | |
## (change apt-get to yum if you use an RPM-based image) | |
## | |
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )' | |
## |
func fetchResultsFromApi() { | |
struct MyGitHub: Codable { | |
let name: String? | |
let location: String? | |
let followers: Int? | |
let avatarUrl: URL? | |
let repos: Int? | |
private enum CodingKeys: String, CodingKey { |
ActiveAdmin.register App do | |
ActionController::Parameters.permit_all_parameters = true | |
menu priority: 6, label: "Uygulamalar" | |
index do | |
selectable_column | |
excluded = ["app_image","updated_at","domain_id"] | |
(App.column_names - excluded).each do |c| | |
column c.to_sym | |
end |
[ | |
{ "code":"AF", "country" : "Afghanistan", "bound": [60.53, 29.32, 75.16, 38.49] }, | |
{ "code":"AO", "country" : "Angola", "bound": [11.64, -17.93, 24.08, -4.44] }, | |
{ "code":"AL", "country" : "Albania", "bound": [19.3, 39.62, 21.02, 42.69] }, | |
{ "code":"AE", "country" : "United Arab Emirates", "bound": [51.58, 22.5, 56.4, 26.06] }, | |
{ "code":"AR", "country" : "Argentina", "bound": [-73.42, -55.25, -53.63, -21.83] }, | |
{ "code":"AM", "country" : "Armenia", "bound": [43.58, 38.74, 46.51, 41.25] }, | |
{ "code":"AQ", "country" : "Antarctica", "bound": [-180.0, -90.0, 180.0, -63.27] }, | |
{ "code":"TF", "country" : "French Southern Territories", "bound": [68.72, -49.78, 70.56, -48.63] }, | |
{ "code":"AU", "country" : "Australia", "bound": [113.34, -43.63, 153.57, -10.67] }, |
MutableLiveData Example |
---|
# the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915 | |
# worked, but only after I added in line 8 | |
sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat | |
sudo apt-get autoremove | |
sudo apt-get install imagemagick libmagickwand-dev | |
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config | |
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig | |
gem install rmagick |
override func viewDidAppear(_ animated: Bool) { | |
var frame = tableView.frame | |
frame.size.height = tableView.contentSize.height | |
tableView.frame = frame | |
tableviewHeightConstraint.constant = tableView.contentSize.height | |
} |
extension String { | |
var twoFractionDigits: String { | |
let styler = NumberFormatter() | |
styler.minimumFractionDigits = 2 | |
styler.maximumFractionDigits = 2 | |
styler.numberStyle = .currency | |
let converter = NumberFormatter() | |
converter.decimalSeparator = "." | |
if let result = converter.number(from: self) { | |
return styler.string(for: result) ?? "" |
// | |
// AdDetailVC.swift | |
// | |
// | |
// Created by GriSoft Mobile on 31.03.2018. | |
// Copyright © 2018 All rights reserved. | |
// | |
import UIKit |