Skip to content

Instantly share code, notes, and snippets.

View plam4u's full-sized avatar
🏠
Working from home

Plamen Andreev plam4u

🏠
Working from home
View GitHub Profile
@plam4u
plam4u / DebugWithKeyboard.m
Last active January 10, 2017 18:32
Debugging via keyboard shortcuts.return array of UIKeyCommand objects, which define a keyboard shortcut.The ViewController will execute corresponding actions mapped to the shortcut.Useful when you want to simulate interactivity but the UI is not ready yet or when you just need to do some debug work.
- (BOOL)canBecomeFirstResponder
{
return YES;
}
-(NSArray *)keyCommands
{
return @[
[UIKeyCommand keyCommandWithInput:@"1" modifierFlags:0 action:@selector(debugCommand1)],
[UIKeyCommand keyCommandWithInput:@"2" modifierFlags:0 action:@selector(debugCommand2)]
@mokagio
mokagio / install-xcode-cli-tools.sh
Created September 9, 2015 09:28
Install Xcode CLI Tools without GUI
#!/bin/bash
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line
echo "Checking Xcode CLI tools"
# Only run if the tools are not installed yet
# To check that try to print the SDK path
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."
@yatatsu
yatatsu / AppDelegate.m
Created June 9, 2014 07:02
ios, debug
#if DEBUG
// http://www.zero4racer.com/blog/480
static void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
}
#endif
@implementation AppDelegate
@rinatkhanov
rinatkhanov / gist:9583748
Created March 16, 2014 14:05
UIView+Debug.m
//
// UIView+Debug.m
// Symbols
//
// Created by Khanov on 16/03/14.
// Copyright (c) 2014 Khanov. All rights reserved.
//
#import "UIView+Debug.h"
@tylerneylon
tylerneylon / learn.lua
Last active April 2, 2024 15:09
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@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:

@zenorocha
zenorocha / README.md
Last active April 6, 2024 16:59
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@jimrutherford
jimrutherford / UIImage+ImageWithColor.h
Created December 3, 2012 23:49
A simple category on UIImage that will tint a named image with a UIColor
//
// UIImage+ImageWithColor.h
// WordClock
//
// Created by James Rutherford on 2012-12-03.
// Copyright (c) 2012 Braxio Interactive. All rights reserved.
//
@danielphillips
danielphillips / DPAnnotationView.h
Last active February 25, 2016 08:48
MKAnnotationView subclass to implement lift and drop animations for your custom map pin. Use this in exactly the same was as MKPinAnnotationView or use the implementation in conjunction with your existing MKAnnotationView subclass.
#import <MapKit/MapKit.h>
@interface DPAnnotationView : MKAnnotationView
@property (nonatomic, assign) MKMapView *mapView;
@end
@dystonie
dystonie / Asset.m
Created August 20, 2012 12:47
NSLog Debugging
#ifdef DEBUGX
NSLog(@"%s %@", __FUNCTION__, objectToDisplay));
#endif