Skip to content

Instantly share code, notes, and snippets.

View aokj4ck's full-sized avatar
❄️

Jack Alto aokj4ck

❄️
View GitHub Profile
@dskuza
dskuza / SafariLink.swift
Created January 7, 2024 19:41
SFSafariViewController in SwiftUI
@izmcm
izmcm / xcodeproj_cleaner.py
Last active March 17, 2023 16:42
List files that are in your code folder but are not referenced in your Xcode project or duplicate files that were created by wrong git rebases
from pbxproj import XcodeProject
import os
from glob import glob
import collections
import sys
TYPE_OF_FILE = 'swift'
# Get all files in project folder
project_folder_path = sys.argv[1]
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
import Darwin
extension Int {
static func random() -> Int {
return Int(arc4random())
}
static func random(range: Range<Int>) -> Int {
return Int(arc4random_uniform(UInt32(range.endIndex - range.startIndex))) + range.startIndex
}
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@wjlafrance
wjlafrance / gist:1291394
Created October 16, 2011 20:38
Downcase all files in current directory
for f in *; do mv $f `echo $f | ruby -e 'puts gets.downcase'`; done
@stevestreza
stevestreza / NSURL+Pieces.h
Created September 26, 2011 19:52
A method for debugging NSURLs to find where the different pieces of your URL are
#import <Foundation/Foundation.h>
@interface NSURL (Pieces)
-(NSDictionary *)piecesDictionary;
@end
@jasonrudolph
jasonrudolph / about.md
Last active May 14, 2024 16:36
Programming Achievements: How to Level Up as a Developer
@chrishulbert
chrishulbert / WeakReferenceSet.m
Created June 21, 2011 04:18
NSMutableSet with weak references eg doesn't retain added objects
// WeakReferenceSet.h
// Created by chris.hulbert@gmail.com on 21/06/11.
#import <Foundation/Foundation.h>
@interface WeakReferenceSet : NSObject
+ (WeakReferenceSet*)set;
- (void)addObject:(id)object;
- (void)removeObject:(id)object;