Skip to content

Instantly share code, notes, and snippets.

View nacho4d's full-sized avatar

Guillermo Ignacio Enriquez Gutierrez nacho4d

View GitHub Profile
@Ponyboy47
Ponyboy47 / Logger.swift
Created September 10, 2018 22:15
Proof of Concept of a Swift Logger
import Foundation
import Dispatch
// Special queue for flushing the logs
private let loggingQueue = DispatchQueue(label: "com.logging.queue", qos: .utility)
// The application-wide logger object
public var logger: Logger = GlobalLogger.global
// A global logger which flushes data using the loggingQueue
//
// Punycode.swift
//
// Created by Mike Kasianowicz on 9/7/15.
// Copyright © 2015 Mike Kasianowicz. All rights reserved.
//
import Foundation
public class Punycode {
@maciekish
maciekish / UINavigationBar+CustomHeight.h
Created September 10, 2014 08:48
Custom UINavigationBar height working in iOS 7 and 8. To use, find your navigation bar reference and just setHeight:200 etc.
//
// UINavigationBar+CustomHeight.h
//
// Copyright (c) 2014 Maciej Swic
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
anonymous
anonymous / UIImage+RoundedCorners.m
Created October 25, 2013 06:18
UIImage with rounded corners
// This could be done using CALayer cornerRadius property
// This is an example of how would be done without that :-)
@interface UIImage (RoundedCorners)
- (UIImage *)roundedImageWithCornerRadius:(CGFloat)cornerRadius;
@end
@implementation UIImage (RoundedCorners)
@steipete
steipete / UIKitLegacyDetector.m
Last active March 12, 2024 13:57
A simple way to detect at runtime if we're running in UIKit legacy mode or the new "flat" variant. Written for our PDF iOS SDK (http://pspdfkit.com), where the precompiled binary needs to detect at runtime in what variant it's running. Want more stuff like that? Follow me on Twitter: http://twitter.com/steipete
// Taken from http://PSPDFKit.com. This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ryanmaxwell
ryanmaxwell / ryan-objc.cfg
Last active June 26, 2019 16:41
Objective-C Uncrustify Config
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
@remcoder
remcoder / typescript.sublime-build
Created October 1, 2012 19:48
Sublime Text 2 build system for Typescript
{
"selector": "source.ts",
"cmd": ["tsc", "$file"],
"file_regex": "^(.+?) \\((\\d+),(\\d+)\\)(: .+)$",
"line_regex": "\\((\\d+),(\\d+)\\)",
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
@nacho4d
nacho4d / UniversalCharsetDetectorResults.md
Created June 5, 2012 11:10
Universal Charset Detector Results

Universal Charset Detector:

Possible Encodings:

  • "ibm850"

  • "ASCII"

  • "UTF-8"

  • "X-ISO-10646-UCS-4-3412"

  • "X-ISO-10646-UCS-4-2143"

@jakemarsh
jakemarsh / reset_simulator.applescript
Created January 20, 2012 14:57
Simple Applescript that can be run from the command line to programmatically reset the iOS simulator.
tell application "iPhone Simulator"
activate
end tell
tell application "System Events"
tell process "iPhone Simulator"
tell menu bar 1
tell menu bar item "iOS Simulator"
tell menu "iOS Simulator"
click menu item "Reset Content and Settings…"