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
// | |
// RikerIpsum.h | |
// | |
// Based on http://www.rikeripsum.com | |
// Created by @frijole on 3/19/13. | |
// | |
#import <Foundation/Foundation.h> | |
@interface RikerIpsum : NSObject |
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 UIKit | |
import Vision | |
class ImageScanner: NSObject { | |
struct ImageSlices { | |
var registrationSlice: UIImage | |
var operatorSlice: UIImage | |
var flightSlice: UIImage | |
var originSlice: UIImage | |
var destinationSlice: UIImage |
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
say you have some files, maybe youtube-dl output, thats includes an mpeg 4 video file and captions in ttml format like this: | |
$ ls | |
Destroy the Technostructure.description | |
Destroy the Technostructure.en.ttml | |
Destroy the Technostructure.jpg | |
Destroy the Technostructure.mp4 | |
and you want to prepare a nice mp4 file to use in Home Sharing with that subtitle track available like a real movie. |
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
def show_sample_loop(): | |
matrix = artdsb_led.api_get_display() | |
draw, image = artdsb_led.api_get_drawing() | |
ttfFont = load_font() | |
artdsb_led.api_clear_screen(draw) | |
artdsb_led.api_draw_text(draw, ttfFont, "Ready.") | |
artdsb_led.api_display_image(image, matrix) | |
iteration = 0 |
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 | |
dmg_path="$1" | |
# use process redirection to capture the mount point and dev entry | |
IFS=$'\n' read -rd '\n' mount_point dev_entry < <( | |
# mount the diskimage; leave out -readonly if making changes to the filesystem | |
hdiutil attach -readonly -plist "$dmg_path" | \ | |
# convert output plist to json |
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 time | |
import subprocess | |
from board import SCL, SDA | |
import busio | |
from PIL import Image, ImageDraw, ImageFont | |
import adafruit_ssd1305 | |
import urllib.request, json | |
import sys |
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
// If you have a later version of carthage installed: | |
$ brew uninstall --force carthage | |
// To install Carthage 0.29.0: | |
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/45dd24d8dfa7a2fb69812c678ceb34be0c16e295/Formula/carthage.rb |
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
@interface DynamicCollectionView : UICollectionView | |
@end | |
@implementation DynamicCollectionView | |
- (void) layoutSubviews | |
{ | |
[super layoutSubviews]; |
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
- (NSUInteger)supportedInterfaceOrientations | |
{ | |
UIInterfaceOrientationMask rtnOrientationMask = UIInterfaceOrientationMaskPortrait; | |
if ( UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ) { | |
rtnOrientationMask = UIInterfaceOrientationMaskAll; | |
} else if ( [UIScreen mainScreen].bounds.size.height > 600.0f || [UIScreen mainScreen].bounds.size.width > 600.0f ) { | |
rtnOrientationMask = UIInterfaceOrientationMaskAllButUpsideDown; | |
} else { | |
rtnOrientationMask = UIInterfaceOrientationMaskPortrait; |
NewerOlder