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
extension String { | |
static var minusR: UIImage { | |
let str = "/9j/4AAQSkZJRgABAQEAlgCWAAD//gBARmlsZSBzb3VyY2U6IGh0dHA6Ly9jb21tb25zLndpa2ltZWRpYS5vcmcvd2lraS9GaWxlOlN0aW5nMi5qcGf/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCADVANwDASIAAhEBAxEB/8QAHQAAAAcBAQEAAAAAAAAAAAAAAAECAwUGBwQICf/EAEoQAAECBQMBBQMIBgYIBwAAAAECAwAEBREhBhIxQQcTUWFxFCKBFSMyQpGhsdMIFlKVwdEXVmJygvAYMzQ2Q1Nz4UZldYWSoqP/xAAbAQABBQEBAAAAAAAAAAAAAAAEAAECAwUGB//EADARAAICAQMDAQUIAwEAAAAAAAECAAMRBBIhBTFBURMiYaHRBhUjMlJxscEUgfAz/9oADAMBAAIRAxEAPwDFyCk8+9fBEESoqNlKIJuQScnxhwgXNreQggnN41Y2I2u2L3IgEXGLXH3wspxa0Jtb0EMTEBDbsQScH0hdhtVYHmCATm9vjAJBIub2xECcSajMAFsgkL5H8LecTNN05UqqhamUDvtpWhp5exx0DJ2X5PlEloLRtQ1bUAJVapaXaIU5MkYQLjg+MerqKwhpliTlpj5RQx7rsxOJClccA2gHUanadohVdXG5hPFAbPgYNKbHzB8Y9sTlEps6HENykm24m+5IZT74PW9uYhNTaK0nMS0vMVakyyVIIQZhhGw3/tAciBTqxnmXKq8ATyOkCwuR4Q+kZ5j05WOzulT1Pep8tKIaWEb |
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
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { | |
dismiss(animated: true, completion: nil) | |
guard let image = info["UIImagePickerControllerOriginalImage"] as? UIImage else { | |
return | |
} | |
UIGraphicsBeginImageContextWithOptions(CGSize(width: 224, height: 224), true, 1.0) | |
image.draw(in: CGRect(x: 0, y: 0, width: 224, height: 224)) | |
let newImage = UIGraphicsGetImageFromCurrentImageContext()! |
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
// kbunfuck.m | |
// | |
// sets keyboard back to normal | |
#import <Foundation/Foundation.h> | |
#import <IOKit/hidsystem/IOHIDEventSystemClient.h> | |
#import <IOKit/hidsystem/IOHIDServiceClient.h> | |
#import <IOKit/hid/IOHIDUsageTables.h> | |
int main(int argc, const char * argv[]) { |
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
// kbfuck.m | |
// | |
// randomly remaps all keys on keyboard in macOS | |
#import <Foundation/Foundation.h> | |
#import <IOKit/hidsystem/IOHIDEventSystemClient.h> | |
#import <IOKit/hidsystem/IOHIDServiceClient.h> | |
#import <IOKit/hid/IOHIDUsageTables.h> | |
int main(int argc, const char * argv[]) { |
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
class Team { | |
let cityName: String | |
let teamName: String | |
let shortName: String | |
var fullName: String { | |
get { | |
return cityName + " " + teamName | |
} |
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 Foundation | |
operator postfix ‽ {} | |
@postfix func ‽<T>(value: T?) -> T? { | |
return (arc4random_uniform(2) == 1) ? value : nil | |
} |
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
override func viewDidAppear(animated: Bool) { | |
super.viewDidAppear(animated); | |
let alert = UIAlertView(title: "Hello", message: "There", delegate: nil, cancelButtonTitle: "OK") | |
alert.show() | |
} |
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 <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
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 need: | |
- Arduino | |
- Ethernet Shield | |
- Sparkfun Serial LCD Kit | |
- Webduino library https://github.com/sirleech/Webduino | |
- Buzzer (optional) | |
Hook up: |
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
// | |
// EPFBounceAnimation.h | |
// | |
// Created by Chris Cieslak on 12/22/11. | |
// | |
#import <QuartzCore/QuartzCore.h> | |
@interface EPFBounceAnimation : CAKeyframeAnimation |