Skip to content

Instantly share code, notes, and snippets.

View dev4dev's full-sized avatar
💭
Beep Boop Beep

Alex Antonyuk dev4dev

💭
Beep Boop Beep
View GitHub Profile
@matthiasplappert
matthiasplappert / gist:9493050
Last active August 29, 2015 13:57
QuickLook Debugging for `UIView`
@interface UIView (MPAdditions)
@end
@implementation UIView (MPAdditions)
- (id)debugQuickLookObject {
if (self.bounds.size.width < 0.0f || self.bounds.size.height < 0.0f) {
return nil;
}
@girasquid
girasquid / ubuntu_setup.sh
Created September 24, 2011 17:30 — forked from kylefox/ubuntu_setup.sh
Automated setup for a Ubuntu server with git, ruby, rvm, nginx.
#!/usr/bin/env bash
# ----------------------------------------------------
#
# Automated setup for a Ubuntu server with git, ruby, rvm, nginx.
# (Used at Carbonmade)
#
# Usage:
# - SCP this file to your server: scp ubuntu_setup.sh you@server:~
# - Make it executable: chmod +x ubuntu_setup.sh
# - Run it: bash ubuntu_setup.sh
@mattdonnelly
mattdonnelly / UIImage+vImageScaling.h
Last active November 8, 2019 17:20
An Objective-C UIImage category for better resizing using vImage
//
// UIImage+vImageScaling.h
// UIImage+vImageScaling
//
// Created by Matt Donnelly on 03/07/2013.
// Copyright (c) 2013 Matt Donnelly. All rights reserved.
//
#import <UIKit/UIKit.h>
@subdigital
subdigital / install_provisioning_profile.sh
Created February 27, 2013 17:10
Script to install provisioning profiles on a build server
#! /bin/sh
# Takes a provisioning profile and installs it into the system path.
# This requires poking inside the provisioning profile and searching for the
# UUID present at the end of the file.
set -e
if [[ -z "$1" ]]
then
@m2orris
m2orris / uncrustify_obj_c.cfg
Last active January 14, 2021 06:14
My uncrustify configuration file that I use for Objective-C.
# Uncrustify 0.60
newlines = auto
input_tab_size = 4
output_tab_size = 4
string_escape_char = 92
string_escape_char2 = 0
tok_split_gte = false
utf8_bom = ignore
utf8_byte = false
utf8_force = false
@stephanecopin
stephanecopin / Publishers+CombineLatestMany.swift
Created February 13, 2020 00:58
An implemention of `CombineLatestMany` for Combine (Swift), which takes takes an array of `Publisher` and return a collection of values, based on their latest value.
import Combine
private protocol LockImplementation {
mutating func lock()
mutating func `try`() -> Bool
mutating func unlock()
}
private struct UnfairLock: LockImplementation {
private var unfairLock = os_unfair_lock_s()
@JofArnold
JofArnold / Login.m
Last active October 26, 2022 13:31
Using promises in React Native modules with Swift
// Created by react-native-create-bridge
// import RCTBridgeModule
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#elif __has_include(“RCTBridgeModule.h”)
#import “RCTBridgeModule.h”
#else
#import “React/RCTBridgeModule.h” // Required when used as a Pod in a Swift project
#endif
@bjhomer
bjhomer / cross-view-lines.swift
Last active November 5, 2022 05:31
Creating cross-view lines in SwiftUI
//
// ContentView.swift
// SwiftUIPlayground
//
// Created by BJ Homer on 4/26/21.
//
import SwiftUI
@dsabanin
dsabanin / enable-xcode-debug-menu.sh
Last active November 7, 2022 16:17
Enable internal Xcode debug menu in Xcode 11
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
# Don't forget to restart Xcode
@lukeredpath
lukeredpath / ExampleClass.m
Created June 30, 2011 22:18
Macro for creating your "shared instance" using GCD
@implementation MySharedThing
+ (id)sharedInstance
{
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
return [[self alloc] init];
});
}
@end