import UIKit
class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
@IBOutlet weak var collectionView: UICollectionView!
override func viewDidLoad() {
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
//http://compform.net/js_lab/js_lab.html?/pixels/sketches/basic_pixels_3.js | |
//https://p5js.org/examples/advanced-data-load-saved-json.html | |
// require https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.14/p5.js | |
function setup() { | |
createCanvas(500, 500); | |
} | |
function draw() { |
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
<?php | |
/* | |
* qtfaststart.php v0.1 by Valentin Schmidt | |
* based on qt-faststart.c v0.2 by Mike Melanson (melanson@pcisys.net) | |
* | |
* This file is placed in the public domain. Use the program however you | |
* see fit. | |
* | |
* This utility rearranges a Quicktime file such that the moov atom | |
* is in front of the data, thus facilitating network streaming. |
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
// | |
// AmazonProduct.swift | |
// Requires SHXMLParser for parsing Amazon's XML responses (https://github.com/simhanature/SHXMLParser) | |
// | |
// Created by Cory Alder on 2015-01-11. | |
// Copyright (c) 2015 Davander Mobile Corporation. All rights reserved. | |
// | |
// partly inspired by RWMAmazonProductAdvertisingManager | |
import Alamofire |
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
do { | |
try audioPlayer = AVAudioPlayer(contentsOf: url) | |
audioPlayer.isMeteringEnabled = true | |
audioPlayer.enableRate = true | |
audioPlayer.prepareToPlay() | |
} catch let error as NSError { | |
print("audioPlayer error \(error.localizedDescription)") | |
} | |
audioPlayer.play() |
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
NSURLErrorUnknown = -1, | |
NSURLErrorCancelled = -999, | |
NSURLErrorBadURL = -1000, | |
NSURLErrorTimedOut = -1001, | |
NSURLErrorUnsupportedURL = -1002, | |
NSURLErrorCannotFindHost = -1003, | |
NSURLErrorCannotConnectToHost = -1004, | |
NSURLErrorNetworkConnectionLost = -1005, | |
NSURLErrorDNSLookupFailed = -1006, | |
NSURLErrorHTTPTooManyRedirects = -1007, |
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 | |
echo 'deb http://shadowsocks.org/debian wheezy main' >> /etc/apt/sources.list | |
# Pre-requisites | |
sudo apt-get -y update | |
sudo apt-get -y install pptpd | |
sudo apt-get -y install fail2ban | |
sudo apt-get -y install shadowsocks-libev | |
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
#!/bin/bash | |
# Script will output dumps for all databases using seperate files | |
# Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/ | |
USER="root" | |
PASSWORD="SnM1073k" | |
HOST="localhost" | |
MYSQL="$(which mysql)" | |
MYSQLDUMP="$(which mysqldump)" | |
OUTPUT_DIR="/backups/files" |
NewerOlder