Skip to content

Instantly share code, notes, and snippets.

View mutablestudio's full-sized avatar

Mutable Studio mutablestudio

View GitHub Profile
/*
* This is a GPUImageFilter Factory concept, essentially to reuse common GPUImage code that's
* required for most GPUImageFilter calls. Access to these methods then becomes a one liner...
*
* Be sure to wrap each new Class method you create with @autoreleasepool for improved performance.
*
*/
#import "GPUImage.h"
#import "mach/mach.h"
@mutablestudio
mutablestudio / performSelectorWithArgument
Last active February 14, 2017 12:41
swift 3 perform selector with argument
//if you have a dictionary object passed in, and one element is the function name you can do the following
//inbound 'params' as [String: Any]
let funcName = String(format: "%@:", (params["function"] as? String)!) //note the ':' for single parameter method
let selector = NSSelectorFromString(funcName)
self.perform(selector, with: params)
func getSomeData(_ params: [String: Any]) {
print(params)
}

Keybase proof

I hereby claim:

  • I am mutablestudio on github.
  • I am mutablestudio (https://keybase.io/mutablestudio) on keybase.
  • I have a public key ASBLPMBWbBgZDiqw_IQ47mVdoS5eyZZZt-Hghs3S7GZeYwo

To claim this, I am signing this object:

@mutablestudio
mutablestudio / sizeclass
Last active February 22, 2019 16:45
react-native size class func
export const isMediumHeight = height < 750 && height >= 600
export const isSmallHeight = width < 600
export const setImageScale = (size, type) => {
console.log(`smallImageScale height ${height} size ${size} type ${type}`)
switch(true) {
case isMediumHeight:
reduceBy = type === 'large' ? .55 : .85
return Math.round(size * reduceBy);
case isSmallHeight:
@mutablestudio
mutablestudio / ChatGPT-Seinfeld-episode
Created May 16, 2023 08:34
ChatGPT 3.5 - write a new Seinfeld episode where Kramer, George and Jerry discuss the benefits of an all cereal diet
INT. JERRY'S APARTMENT - DAY
Kramer bursts into Jerry's apartment carrying a large box of cereal. George is sitting on the couch, eating a bag of chips.
Kramer: Jerry, you won't believe it. I'm starting an all cereal diet!
George: (sarcastically) Oh boy, here we go again. What's wrong with regular food, Kramer?
Kramer: (ignoring George's comment) What's wrong with cereal? It has all the essential vitamins and minerals you need.