Skip to content

Instantly share code, notes, and snippets.

@asmarques
asmarques / mongodb26-elcapitan.diff
Created October 4, 2015 13:10
Fix build of MongoDB 2.6.10 on Mac OS X 10.11 El Capitan
diff -u a/SConstruct b/SConstruct
--- a/SConstruct 2015-10-04 14:03:55.000000000 +0100
+++ b/SConstruct 2015-10-04 14:04:47.000000000 +0100
@@ -307,7 +307,7 @@
0, False)
if darwin:
- osx_version_choices = ['10.6', '10.7', '10.8', '10.9']
+ osx_version_choices = ['10.6', '10.7', '10.8', '10.9', '10.10', '10.11']
add_option("osx-version-min", "minimum OS X version to support", 1, True,
@asmarques
asmarques / docker.sh
Created April 3, 2016 15:22
Init script for running Docker on Synology DSM 5.x
#!/bin/sh
source /usr/syno/etc.defaults/iptables_modules_list
DOCKER=/volume1/.docker/bin/docker
DOCKER_ROOT=/volume1/.docker/root
DOCKER_CERTS=/volume1/.docker/etc/certs
DOCKER_PID=/var/run/docker.pid
DOCKER_LOG=/var/log/docker.log
DOCKER_OPTS_TLS="--tlsverify --tlscacert=$DOCKER_CERTS/ca.pem --tlscert=$DOCKER_CERTS/server.pem --tlskey=$DOCKER_CERTS/server-key.pem"
DOCKER_OPTS="--log-level=error --storage-driver=aufs -g $DOCKER_ROOT -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -p $DOCKER_PID $DOCKER_OPTS_TLS"
@asmarques
asmarques / UITableView.swift
Created May 15, 2017 06:51
Autosize UITableView header and footer views
extension UITableView {
func autoSizeHeaderAndFooter() {
let width = self.bounds.width
let autoSize = { (view: UIView) in
view.translatesAutoresizingMaskIntoConstraints = false
let widthConstraint = NSLayoutConstraint(item: view,
attribute: NSLayoutAttribute.width,
relatedBy: NSLayoutRelation.equal,
toItem: nil,
@asmarques
asmarques / UIView.swift
Created May 15, 2017 06:55
UIView shadows in Interface Builder
import UIKit
extension UIView {
@IBInspectable var shadowColor: UIColor? {
set {
layer.shadowColor = newValue?.cgColor
}
get {
if let color = layer.shadowColor {
return UIColor(cgColor: color)