Skip to content

Instantly share code, notes, and snippets.

@dsowsy
dsowsy / gist:1c38cf2d994671642c544ac78523a6b3
Created May 30, 2024 18:50
AI: Your Age Friendly Ally - Prompts that were used
The following prompts were some of the prompts I've used along the way in my process, separated by "---",
anything in angle brackets <like this>, you fill in the appropriate details.
Note: For sections that are applying rules to a resume and a job description, type "Apply Rule <number>" like "Apply Rule 1" to the data mentioned.
---
Please analyze this job description for any potential red flags that might indicate the employer is not age-friendly. Focus on specific details within the description that could suggest a preference for younger candidates. Use the following format:
Job Description Analysis: [Job Title] at [Company]
Potential Red Flags for Age-Friendliness
@dsowsy
dsowsy / .login
Last active November 2, 2016 13:09
Terminal compilation of OpenCV apps on Mac
# Usage: makeOpenCV <filename.cpp>
makeOpenCV(){
g++ -ggdb `pkg-config --cflags --libs opencv` -stdlib=libc++ $1 -o /tmp/test $
}
@dsowsy
dsowsy / Sepia.swift
Created October 28, 2015 18:00
GPUImage Still image filter example in Swift
// Posted this example because I couldn't get the example from the GPUImage page working directly.
let stillImageSource = GPUImagePicture()
let stillImageFilter = GPUImageSepiaFilter()
stillImageSource.addTarget(stillImageFilter)
stillImageFilter.useNextFrameForImageCapture()
let destImage = stillImageFilter.imageByFilteringImage(srcImage)
@dsowsy
dsowsy / UIImage+GPUImage.swift
Created October 28, 2015 17:35
The pattern I use for chaining GPUImage filters on a single UIImage
import Foundation
extension UIImage {
func blur() -> UIImage {
let boxBlur = GPUImageBoxBlurFilter()
boxBlur.blurRadiusInPixels = 4.0
return boxBlur.imageByFilteringImage(self)
}
func canny() -> UIImage {
@dsowsy
dsowsy / Snapshot.swift
Created October 28, 2015 17:24
Snapshot any UIView
extension UIView {
func snapshot() -> UIImage {
UIGraphicsBeginImageContextWithOptions(bounds.size, false, UIScreen.mainScreen().scale)
drawViewHierarchyInRect(self.bounds, afterScreenUpdates: true)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
}
@dsowsy
dsowsy / SimpleAlertWrapper.swift
Last active October 28, 2015 17:25
Simple alert wrapper func
func showAlert(title: String, message: String){
let alertController = UIAlertController(title: title, message:message, preferredStyle: .Alert)
let defaultAction = UIAlertAction(title: "OK", style: .Cancel, handler: nil)
alertController.addAction(defaultAction)
self.presentViewController(alertController, animated: true, completion: nil)
}
@dsowsy
dsowsy / FilterBuilder.swift
Created October 28, 2015 17:11
GPUImage Filter chaining in Swift. Uses LinkedList from Wayne Bishop's SwiftStructures
struct FilterBuilder {
let list = LinkedList<GPUImageFilter>()
mutating func build(filters: GPUImageFilter...) -> GPUImageFilterGroup {
let group = GPUImageFilterGroup()
for filter in filters { list.addLink(filter) }
var i = 0
while (list.linkAtIndex(i).next != nil ){
let curr = list.linkAtIndex(i)
group.addFilter(curr.key)
designDoc =
_id: "_design/blog"
language: "javascript"
views:
posts_by_date:
map: (doc) ->
emit doc.postedAt, doc if doc.type is "post".toString()