Skip to content

Instantly share code, notes, and snippets.

View alikaragoz's full-sized avatar
🍉
Tap Tap Tap

Ali Karagoz alikaragoz

🍉
Tap Tap Tap
View GitHub Profile
@alikaragoz
alikaragoz / SFSymbolEmojiLookupTable.json
Created November 15, 2023 13:20
SFSymbol Emoji Lookup Table
{
"externaldrive.fill.trianglebadge.exclamationmark":"\u26a0\ufe0f",
"tag.fill":"\ud83c\udff7\ufe0f",
"keyboard.badge.eye":"\ud83d\udc41\ufe0f",
"airpodspro.chargingcase.wireless.fill":"\ud83c\udfa7",
"figure.hockey":"\ud83c\udfd2",
"road.lanes.curved.left":"\ud83d\udd04",
"plus.app":"\u2795",
"axel.2.front.and.rear.engaged":"\ud83d\udd29",
"car.rear.fill":"\ud83d\ude97",
@alikaragoz
alikaragoz / EmojiParty.swift
Created October 19, 2023 13:02
Emoji Party SpriteKit
import SpriteKit
import SwiftUI
// MARK: - GameScene
class GameScene: SKScene {
override func didMove(to _: SKView) {
physicsBody = SKPhysicsBody(edgeLoopFrom: frame)
}
@alikaragoz
alikaragoz / RubberBandSwitch.swift
Created October 12, 2023 12:20
iOS Control Center Rubber Band Swift
import SwiftUI
struct RubberBandSwitch: View {
enum Const {
static let shapeSize: CGSize = .init(width: 90.0, height: 190.0)
static let cornerRadius: CGFloat = 26.0
}
@State var value = 0.5
@alikaragoz
alikaragoz / Assert.h
Created February 4, 2015 10:34
Clever assertions
#define AssertOr(condition, action) { \
BOOL evaluatedCondition = !!(condition); \
if (!evaluatedCondition) { \
NSAssert(evaluatedCondition, @#condition); \
action \
} \
} \
#define AssertOrReturnNil(condition) AssertOr(condition, return nil;)
@alikaragoz
alikaragoz / keybase.md
Created December 9, 2014 10:27
Keybase proof

Keybase proof

I hereby claim:

  • I am alikaragoz on github.
  • I am alikaragoz (https://keybase.io/alikaragoz) on keybase.
  • I have a public key whose fingerprint is C609 96C6 E878 49C6 58CC 4D50 9886 9103 3E86 B86D

To claim this, I am signing this object:

@alikaragoz
alikaragoz / xc.rb
Created February 9, 2014 18:26
xcode workspaces command line opener
#!/usr/bin/env ruby
directories = Dir.glob('*').select {
|f| File.directory? f
}
workspace = nil
directories.each do |folder|
if folder.include? ".workspace"
// Defines a yet undocumented method to add a warning if super isn't called.
#ifndef NS_REQUIRES_SUPER
#if __has_attribute(objc_requires_super)
#define NS_REQUIRES_SUPER __attribute((objc_requires_super))
#else
#define NS_REQUIRES_SUPER
#endif
#endif
@interface UIViewController (SubclassingWarnings)
@alikaragoz
alikaragoz / wget-index.sh
Created January 19, 2014 19:47
Get everything in `/indexof`
wget -r http://suckmycontent/
@alikaragoz
alikaragoz / block-syntax
Created January 19, 2014 19:42
How Do I Declare A Block in Objective-C? source : http://fuckingblocksyntax.com
// As a local variable.
returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};
// As a property.
@property (nonatomic, copy) returnType (^blockName)(parameterTypes);
// As a method parameter.
- (void)someMethodThatTakesABlock:(returnType (^)(parameterTypes))blockName {...}
// As an argument to a method call.
@alikaragoz
alikaragoz / xc.sh
Last active December 23, 2015 18:39
Find and open the first xcworkspace or xcodeproj in a folder.
xc () {
workspaces=(`ls -d1 *.(xcworkspace|xcodeproj) | sed -e "s/\///g"`) &> /dev/null
filenames=(`ls -d1 *.(xcworkspace|xcodeproj) | sed -e "s/\..*$//g"`) &> /dev/null
if [[ ${#workspaces} = 0 ]]
then
echo "No Xcode projects or workspaces were found."
return
fi