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/sh | |
# | |
# Iconizer shell script by Steve Richey ([email protected]) | |
# | |
# This is a simple tool to generate all necessary app icon sizes and the JSON file for an *EXISTING* Xcode project from one file. | |
# To use: specify the path to your vector graphic (PDF format) and the path to your Xcode folder containing Images.xcassets | |
# Example: sh iconizer.sh MyVectorGraphic.pdf MyXcodeProject | |
# | |
# Requires ImageMagick: http://www.imagemagick.org/ |
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
<!-- Camera --> | |
<uses-permission android:name="android.permission.CAMERA" /> | |
<uses-feature android:name="android.hardware.camera" /> | |
<uses-feature android:name="android.hardware.camera.autofocus" /> | |
<!-- GPS --> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> |
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
/** | |
* Prevents displaying NaN to the user. Defaults to 0. | |
*/ | |
Ember.Handlebars.helper("safefloat", function(value, options) { | |
if (Ember.isEmpty(value) || isNaN(value)) { | |
value = 0; | |
} | |
return new Ember.Handlebars.SafeString(value); | |
}); |
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/sh | |
# Fixes "*.app can't be opened" errors | |
# Run `chmod +x` on this file and then | |
# move it to /usr/bin/ to make it GLOBAL | |
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied! Expected a path to a .app file" | |
elif [ -z "$1" ] |
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/sh | |
# exit on error | |
set -e | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: icns myicon.png" | |
exit 0 | |
fi |
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 | |
# Install script for application setup on Wercker boxes | |
# Exit script on error | |
set -e | |
echo "Updating apt-get" | |
# Without updating, apt-get won't find curl | |
apt-get update |
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
// see http://lumiverse.io/series/neural-networks-demystified | |
import Foundation | |
let startTime = NSDate() | |
defer { | |
let endTime = NSDate() | |
print("Total time \(endTime.timeIntervalSinceDate(startTime))") | |
} |
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
extension SequenceType { | |
/** | |
Filter a single sequence into two "buckets", each an array containing objects of this collection's element type. | |
- parameter includeElementInFirstCollection: A method that returns true for elements to include in the first collection. | |
- parameter includeElementInSecondCollection: A method that returns true for elements to include in the second collection. | |
- returns: A tuple of two arrays containing the elements in their respective buckets. | |
*/ | |
@warn_unused_result | |
public func multifilter(@noescape includeInFirst includeElementInFirstCollection: (Self.Generator.Element) throws -> Bool, @noescape includeInSecond includeElementInSecondCollection: (Self.Generator.Element) throws -> Bool) rethrows -> ([Self.Generator.Element], [Self.Generator.Element]) { | |
var firstCollection: [Self.Generator.Element] = [] |
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 CUDA | |
sudo apt-get update | |
wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb" | |
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
sudo apt-get update | |
sudo apt-get install cuda -y | |
export PATH=/usr/local/cuda-7.5/bin:$PATH | |
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH | |
# install MPI (optional, for some samples) |
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
// swiftlint:disable line_length | |
// swiftlint:disable variable_name | |
import Foundation | |
import Cocoa | |
struct PixelData { | |
var a: UInt8 = 255 | |
var r: UInt8 | |
var g: UInt8 |