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
curl https://gist.githubusercontent.com/lattejed/5047d9f85896b8946c7d/raw/e3534c6ac5248ad7bc711c053fec45c22441c87a/gistfile1.sh > secure_ubuntu_10.04_x64.sh | |
scp secure_ubuntu_10.04_x64.sh root@<ip_address or host>:/root/ | |
ssh root@<ip_address or host> chmod +x secure_ubuntu_10.04_x64.sh | |
ssh root@<ip_address or host> ./secure_ubuntu_10.04_x64.sh |
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
# Note: This is for the Ubunutu 18.04.2 x64 image available on Digital Ocean | |
# and may not work for other images / OS versions. | |
# Warning: This script directy edits some configuration files that may | |
# render your OS unusable if there is an error. Use at your own risk. | |
apt-get update | |
read -p "Add new user 'deploy' (recommended) [yN] " -n 1 -r | |
echo |
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
// UITableViewDataSource | |
var isMovingItem : Bool = false | |
override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool { | |
return true | |
} | |
override func tableView(tableView: UITableView, moveRowAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath) { |
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
import CoreData | |
class ToDo: NSManagedObject { | |
@NSManaged | |
var createdAt: NSDate | |
@NSManaged | |
var summary: String? | |
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
import Foundation | |
import UIKit | |
class AlertViewHelper { | |
typealias ActionSheetFinished = (alertView: UIAlertView) -> () | |
var finished: ActionSheetFinished | |
init(finished: ActionSheetFinished) { | |
self.finished = finished | |
} | |
} |
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
brew install ffmpeg gifsicle | |
ffmpeg -i screencast.mov -s 450x810 -r 10 frame%05d.png | |
for i in *.png; do | |
sips -s format gif $i --out $i.gif; | |
done | |
gifsicle --optimize=3 --delay=5 --loop frame*.gif > animation.gif |
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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential curl zlib1g-dev libgmp3-dev libedit2 | |
# GHC 7.8.3 | |
curl -O http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2 | |
tar xvfj ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2 | |
cd ghc-7.8.3 && ./configure | |
make install |
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
apt-get update | |
apt-get install postgresql | |
mkdir -p /opt/keter/bin | |
# Now, copy our local Keter binary to that folder | |
# scp ~/keter [email protected]:/opt/keter/bin/ | |
# Minimally configure Keter | |
mkdir -p /opt/keter/etc | |
cat > /opt/keter/etc/keter-config.yaml <<EOF |
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
wget -O - https://raw.github.com/snoyberg/keter/master/setup-keter.sh | bash | |
# Yes, run it twice as it might abort the first time | |
wget -O - https://raw.github.com/snoyberg/keter/master/setup-keter.sh | bash | |
# You should now have a keter binary at ~/.cabal/bin/keter or /opt/keter/bin/keter | |
# Copy that to your local machine | |
# scp [email protected]:/root/.cabal/bin/keter ~ |
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
# Install the Haskell platform | |
cd / | |
wget https://www.haskell.org/platform/download/2014.2.0.0/haskell-platform-2014.2.0.0-unknown-linux-x86_64.tar.gz | |
tar xvf haskell-platform-2014.2.0.0-unknown-linux-x86_64.tar.gz | |
/usr/local/haskell/ghc-7.8.3-x86-64/bin/activate-hs | |
# Fix issues that will prevent GHC from running on 14.04 | |
apt-get update |