This file contains hidden or 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
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
# Official binaries: https://github.com/borgbackup/borg/releases | |
# ARM binaries: https://borg.bauerj.eu/ | |
wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-1.1.9-armv6 -O /usr/bin/borg |
This file contains hidden or 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
diff -ur pngquant-2.9.0/configure pngquant-2.9.0.fixed/configure | |
--- pngquant-2.9.0/configure 2017-03-06 09:37:30.000000000 +0100 | |
+++ pngquant-2.9.0.fixed/configure 2017-03-07 09:57:20.246012152 +0100 | |
@@ -48,6 +48,7 @@ | |
help "--with-cocoa/--without-cocoa use Cocoa framework to read images" | |
fi | |
help "--with-libpng=<dir> search for libpng in directory" | |
+ help "--with-zlib=<dir> search for zlib in directory" | |
echo | |
help "CC=<compiler> use given compiler command" |
This file contains hidden or 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
<?php | |
$old = [ | |
'muz' => [ | |
'package1' => [ | |
'1.0.0', | |
'1.0.1', | |
'2.0.0' | |
], | |
'package2' => ['1.0.0'], |
This file contains hidden or 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
# Installs some things I need while debuging from inside a docker container | |
apt-get update | |
apt-get install -qy \ | |
vim \ | |
iputils-ping \ | |
dnsutils \ | |
traceroute \ | |
mtr \ | |
apt-file |
This file contains hidden or 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
#!/bin/bash | |
uname -r | |
sudo apt update | |
sudo apt install -y ssh apt-transport-https ca-certificates | |
apt list --upgradeable | |
sudo apt upgrade -y | |
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt update | |
apt-cache policy docker-engine |
This file contains hidden or 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
FROM php:5.6 | |
MAINTAINER Jens Kohl <[email protected]> | |
RUN apt-get update && apt-get install -y \ | |
git-core \ | |
unzip \ | |
rsync \ | |
ssh-client \ | |
--no-install-recommends && apt-get clean |
This file contains hidden or 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
selenium-hub: | |
image: selenium/hub | |
restart: always | |
ports: | |
- 4444:4444 | |
selenium-node-chrome: | |
image: selenium/node-chrome | |
links: | |
- selenium-hub:hub |
This file contains hidden or 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 protocol ReflectedStringConvertible: CustomStringConvertible { } | |
extension ReflectedStringConvertible { | |
public var description: String { | |
let mirror = Mirror(reflecting: self) | |
let classType = "\(mirror.subjectType)(" | |
return classType + mirror.children.flatMap { (label, value) in | |
if let label = label { |
This file contains hidden or 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
extension NSCoder { | |
// works but not optimal | |
func encodeProtocol<T: SequenceType>(objv: T, forKey key: String) { | |
let aCollection = objv.map { $0 as! AnyObject } | |
self.encodeObject(aCollection, forKey: key) | |
} | |
// want: func encodeObject<T: SqeuenceType where T.Element is AnyProtocol>(objv: T, forKey key: String) { ... } | |
This file contains hidden or 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 MyViewController : UIViewController { | |
func refactorThis() { | |
if let navigationController = navigationController, | |
let topViewController = navigatonController.topViewController, | |
let someProperty = topViewController.someproperty { | |
someProperty = "new value" | |
} | |
} | |