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
Instructions to create and deploy production ready web app to Lambda | |
Dev environment @ Ubuntu 14.04 | |
#Install python 2.7.9 (to resolve urllib3\util\ssl_.py: SNIMissingWarning, InsecurePlatformWarning. | |
#https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings) | |
sudo apt-get install -y gcc-multilib g++-multilib libffi-dev libffi6 libffi6-dbg python-crypto python-mox3 python-pil python-ply libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libgdbm-dev dpkg-dev quilt autotools-dev libreadline-dev libtinfo-dev libncursesw5-dev tk-dev blt-dev libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libsqlite3-dev libgpm2 mime-support netbase net-tools bzip2 | |
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz | |
tar xfz Python-2.7.9.tgz | |
cd Python-2.7.9/ |
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
// | |
// BuildTimelapseViewController.swift | |
// | |
// Created by Adam Jensen on 5/9/15. | |
// | |
import JGProgressHUD | |
import JoePro | |
import UIKit |
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
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
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
t = np.arange(16).reshape((4, 4)) | |
t_r90 = np.zeros((4, 4)) #90 deg right | |
t_l90 = np.zeros((4, 4)) #90 deg left | |
t_180 = np.zeros((4, 4)) #180 deg | |
N = t.shape[0] | |
for x in range(0,N): | |
for y in range(0,N): | |
x1=y | |
y1=N-x-1 |
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 scipy.misc import imread, imresize | |
from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, merge, Reshape, Activation | |
from keras.models import Model | |
from keras.regularizers import l2 | |
from keras.optimizers import SGD | |
from googlenet_custom_layers import PoolHelper,LRN | |
def create_googlenet(weights_path=None): |
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 | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
# Inspired from https://gist.github.com/faleev/3435377 | |
# Remove any existing packages: | |
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
# Get the dependencies (Ubuntu Server or headless users): | |
sudo apt-get update |
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 | |
# usage: get [ RESOLUTION [ YEAR [ IDS... ] ] ] | |
resolution=${1:-SD} | |
year=${2:-2015} | |
shift | |
shift | |
ids=$* | |
RESOLUTION=$(echo $resolution | tr '[:lower:]' '[:upper:]') |
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 NSImage { | |
func tint(color: NSColor) -> NSImage { | |
let targetImage = copy() as! NSImage | |
targetImage.lockFocus() | |
color.set() | |
NSRectFillUsingOperation(NSRect(origin: NSZeroPoint, size: size), .CompositeSourceAtop) | |
targetImage.unlockFocus() | |
return targetImage | |
} | |
} |
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 NSImage{ | |
static func create(imageRef:CGImage)->NSImage{ | |
let width:Int = Int(CGImageGetWidth(imageRef)) | |
let height:Int = Int(CGImageGetHeight(imageRef)) | |
return NSImage(CGImage: imageRef, size: NSSize(width: width, height: height)) | |
} | |
} |
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 NSImage{ | |
func resize(targetSize:NSSize) -> NSImage { | |
let newImage = NSImage(size: targetSize) | |
newImage.lockFocus() | |
self.drawInRect(NSMakeRect(0, 0, targetSize.width, targetSize.height), fromRect: NSMakeRect(0, 0, self.size.width, self.size.height), operation: NSCompositingOperation.CompositeSourceOver, fraction: CGFloat(1)) | |
newImage.unlockFocus() | |
newImage.size = targetSize | |
return NSImage(data: newImage.TIFFRepresentation!)! | |
} | |
} |
NewerOlder