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
+ (UIImage *)snapshotView:(UIView *)view { | |
UIGraphicsBeginImageContextWithOptions(view.frame.size, NO, [[UIScreen mainScreen] scale]); //0 | |
[view drawViewHierarchyInRect:view.frame afterScreenUpdates:YES]; | |
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return snapshot; | |
} | |
+ (UIImage *)snapshot { | |
CGSize imageSize = CGSizeZero; |
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 | |
# | |
# Vapor.sh | |
# | |
# Created by Anthony Castelli on 5/31/17 | |
# Copyright © 2017 Anthony Castelli. All rights reserved. | |
# | |
print() { |
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
// | |
// Mailgun+Lists.swift | |
// Canteen | |
// | |
// Created by Anthony Castelli on 5/18/17. | |
// | |
// | |
import Foundation | |
import FormData |
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
// | |
// Fluent+Date.swift | |
// | |
// | |
// Created by Anthony Castelli on 12/10/16. | |
// | |
// | |
import Foundation | |
import Fluent |
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
init() { | |
print("•", RLMRealm.default().configuration.fileURL?.path) | |
var config = Realm.Configuration( | |
// Set the new schema version. This must be greater than the previously used | |
// version (if you've never set a schema version before, the version is 0). | |
schemaVersion: 1, | |
// Set the block which will be called automatically when opening a Realm with | |
// a schema version lower than the one set above |
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
// You'll need this https://gist.github.com/jorgenisaksson/76a8dae54fd3dc4e31c2 | |
extension NSBezierPath { | |
func toCGPath () -> CGPath? { | |
if self.elementCount == 0 { | |
return nil | |
} | |
let path = CGPathCreateMutable() | |
var didClosePath = false |
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
Verifying I am +anth on my passcard. https://onename.com/anth |
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 os | |
import sys | |
import numpy | |
from PIL import Image | |
if len(sys.argv) < 3: | |
print('You must specifiy an image and an output folder') | |
print('i.e. "resizer.py image.png output_folder_name') | |
sys.exit(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
# To run this script, simply call | |
# $ python renamer.py "/path/to/folder" "S01" " - " | |
# This will take a file with a divider in it and add | |
# the appropriate formatting to work better with | |
# Plex Media Server. | |
# i.e. "Season 1 Episode 21 Episode Name.mp4" would become | |
# "S01E21 Episode Name.mp4" | |
import os | |
import sys |
NewerOlder