Skip to content

Instantly share code, notes, and snippets.

@roma86
roma86 / UIcollectionView dynamic sectionheaderSize
Last active May 9, 2019 22:00
This is only works for one section and on header
/// Header setup for content size calucation
class ProductHeader: UICollectionReusableView {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var detailsLabel: UILabel!
class func createFromNib(product: Product) -> ProductHeader {
let view = NSBundle.mainBundle().loadNibNamed("ProductHeader", owner: nil, options: [:]).last! as! ProductHeader
view.setup(product)
return view
@roma86
roma86 / AWSHelpers.swift
Created April 14, 2016 19:31
AWS S3 iOS SDK upload file helper
/*
Created by Georg Romas on 14/04/16.
Convenient class method to upload local file to AWS S3 bucket
Example usage:
AWSS3TransferManager.uploadFile(
url,
bucketName: "storage",
#! /bin/bash
# directory to save backups in, must be rwx by postgres user
BASE_DIR="/var/backups/postgres"
YMD=$(date "+%Y-%m-%d")
DIR="$BASE_DIR/$YMD"
mkdir -p $DIR
cd $DIR
# make database backup
@roma86
roma86 / gist:c896c4e393d5faf88bda
Created June 20, 2015 12:42
Create swap for digitalocean dokku

fix

Dokku errors

runtime: panic before malloc heap initialized
fatal error: runtime: cannot allocate heap metadata

@roma86
roma86 / Add self signed sertificate to boot2docker
Last active March 1, 2018 12:58 — forked from irgeek/bootlocal.sh
Add self signed sertificate to boot2docker
##This script help solve boot2docker self signed certificates issue
**Start here:**
irgeek [shared his solution](https://github.com/boot2docker/boot2docker/issues/347#issuecomment-70950789)
I had to solve this for a second time today as I restarted the VM without realising the way I did it last time wouldn't be persisted. So I created /var/lib/boot2docker/certs/, chucked all of the private certs I need in there and added created /var/lib/boot2docker/bootlocal.sh to install them. Gisted for everyone's downloading pleasure: https://gist.github.com/irgeek/afb2e05775fff532f960
Some notes about the certs in the /var/lib/boot2docker/certs/ directory: