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
- (UIImage *)pointillizedImageFromImage:(UIImage *)image withPointDiameter:(CGFloat)diameter | |
{ | |
CGFloat width = image.size.width; | |
CGFloat height = image.size.height; | |
CGImageRef inImage = [image CGImage]; | |
CFDataRef m_dataRef = CGDataProviderCopyData(CGImageGetDataProvider(inImage)); | |
UInt8* m_pixelBuf = (UInt8*)CFDataGetBytePtr(m_dataRef); | |
UIGraphicsBeginImageContextWithOptions(image.size, YES, 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
#import <Foundation/Foundation.h> | |
// VARIABLE must be a variable declaration (NSString *foo) | |
// VALUE is what you are checking is not nil | |
// WHERE is an additional BOOL condition | |
#define iflet(VARIABLE, VALUE) \ | |
ifletwhere(VARIABLE, VALUE, YES) | |
#define ifletwhere(VARIABLE, VALUE, WHERE) \ |
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
function xc { | |
xcodePath=`xcode-select --print-path | grep ".*\.app" -o` | |
if (( $# == 0 )) | |
then | |
xcworkspace=`ls -1 | grep *.xcworkspace | wc -l` | |
xcproject=`ls -1 | grep *.xcodeproj | wc -l` | |
package=`ls -1 | grep Package.swift | wc -l` | |
if (( $xcworkspace > 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
// | |
// ContentView.swift | |
// Airplane | |
// | |
// Created by Chris Eidhof on 08.02.21. | |
// | |
import SwiftUI | |
struct ContentView: View { |
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
@resultBuilder | |
struct ArrayBuilder<Element> { | |
static func buildBlock(_ components: [Element]...) -> [Element] { | |
components.flatMap { $0 } | |
} | |
static func buildExpression(_ expression: Element) -> [Element] { | |
[expression] | |
} | |
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 | |
################################################################################################### | |
# USAGE | |
################################################################################################### | |
print_usage() { | |
echo -e "Takes screenshots of the pages in the current zoom window" | |
echo -e "\nUsage:" | |
echo -e " ./zoom-screenshots.sh [-d DELAY_BETWEEN_SCREENSHOTS] [-o OUTPUT_DIR]" | |
echo -e "\nFlags (optional):" |
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
#!/usr/bin/swift | |
import Darwin | |
import Foundation | |
var inputString = CommandLine.arguments.dropFirst().joined(separator: " ") | |
if inputString.isEmpty { | |
while let line = readLine(strippingNewline: false) { | |
inputString += line | |
} |