Skip to content

Instantly share code, notes, and snippets.

View bcattle's full-sized avatar

bcattle bcattle

View GitHub Profile
@bcattle
bcattle / decorators.py
Created July 25, 2023 21:44
Minimal working decorator example in the style of `flask.App.route()`
import functools
import numpy as np
class DataServiceManager:
def __init__(self) -> None:
pass
def service(self, **options):
print('service() called')
@bcattle
bcattle / live_timeseries.py
Created August 13, 2019 16:49
Live update plotting of a random timeseries using matplotlib
# Ours, no blit, plot a timeseries
from datetime import datetime
from matplotlib import pyplot
from matplotlib.animation import FuncAnimation
from random import randrange
import numpy as np
n_pts = 256
x_data = np.linspace(0, n_pts-1, n_pts)
y_data = np.zeros(n_pts)
@bcattle
bcattle / image_capture.py
Created August 1, 2019 20:29
Simple python code to capture images from a webcam
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# Install OpenCV with
# pip install opencv-python
@bcattle
bcattle / config-4.4.35-33.55.amzn1.x86_64
Created August 13, 2017 21:54
AWS Lambda Kernel Config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 4.4.35-33.55.amzn1.x86_64 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
@bcattle
bcattle / PhotoLibraryAssetManager.swift
Created November 2, 2016 22:07
Photo Library Asset Manager, a code sample illustrating an asynchronous queue loading assets from Apple's iCloud service
//
// PhotoLibraryAssetManager.swift
// Koowalla
//
// Created by Bryan Cattle on 8/22/16.
// Copyright © 2016 Koowalla, Inc. All rights reserved.
//
import UIKit
import Bolts
@bcattle
bcattle / carthage_2015011018_134951_P7jK.sample.txt
Created November 18, 2015 21:57
Carthage 0.10.0, output of `sample` while process hung during build
Analysis of sampling carthage (pid 73423) every 1 millisecond
Process: carthage [73423]
Path: /usr/local/Cellar/carthage/0.10/bin/carthage
Load Address: 0x102c3d000
Identifier: carthage
Version: 0
Code Type: X86-64
Parent Process: bash [39865]
Date/Time: 2015-11-18 13:49:51.562 -0800
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias ls='ls -G'
alias ll='ls -Gl'
alias la='ls -Ga'
alias grep='grep --color'
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
alias ls='ls -G'
alias ll='ls -Gl'
alias la='ls -Ga'
alias grep='grep --color'
source $HOME/z.sh
Bryans-Mac-2:~ bryan$ mediastreamvalidator https://s3-us-west-2.amazonaws.com/co.koowalla.oregon.video.published/fc909588-4cbc-4882-9f1c-6d879cd35dd4/160/hls.m3u8
mediastreamvalidator: Beta Version 1.1(140602)
Validating master playlist https://s3-us-west-2.amazonaws.com/co.koowalla.oregon.video.published/fc909588-4cbc-4882-9f1c-6d879cd35dd4/160/hls.m3u8
--------------------------------------------------------------------------------
https://s3-us-west-2.amazonaws.com/co.koowalla.oregon.video.published/fc909588-4cbc-4882-9f1c-6d879cd35dd4/160/hls.m3u8
--------------------------------------------------------------------------------
Playlist Syntax:
TWTRComposer *twitterComposer = [TWTRComposer new];
[twitterComposer setText:[NSString stringWithFormat:@"%@ #koowalla", self.taglineField.text]];
// TODO: this needs to be cropped to portrait
[twitterComposer setImage:self.videoThumbnail.image];
[twitterComposer setURL:[NSURL URLWithString:[videoUpload getShareURL]]];
if (twitterComposer != nil) {
[twitterComposer showFromViewController:self completion:^(TWTRComposerResult result){ // <- Attempt to present Exception here
// Main queue?
NSLog(@"");
}];