Skip to content

Instantly share code, notes, and snippets.

//
// EGOTitledTableViewCell.h
// EGOClasses
//
// Created by Shaun Harrison on 6/2/09.
// Copyright 2009 enormego. All rights reserved.
//
#import <UIKit/UIKit.h>
#!/usr/bin/env ruby -w
#
# This is a script to help view a patch file in the Changes.app[1] UI. It is
# pretty basic, but does the job. It simply creates 2 copies of the file,
# where in one (the "original") it strips all the lines starting with '+', and
# the other (the "modified") it strips all the lines starting with '-'. It
# also removes the first character of all lines starting with a space, +, or -
# Then it simply uses the chdiff command line too to view the differences.
#
# It takes input either from filename arguments (multiple files are ok, but it
@jk
jk / XCDFakeCarrier.m
Created July 3, 2012 13:05 — forked from 0xced/XCDFakeCarrier.m
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012 Cédric Luthi / @0xced. All rights reserved.
//
#if TARGET_IPHONE_SIMULATOR
static NSString * const FakeCarrier = @"AT&T";
#import <objc/runtime.h>
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Turn off all checks for some libraries. -->
<suppress checks="." files="com[\\/]google[\\/]..*.java" />
<!-- Turn off header checks for some libraries. -->
<suppress checks="Header" files=".*[\\/]android[\\/]fastroid[\\/].*\.java"/>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: Android Best Practise
Description: none
-->
#! /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
@jk
jk / test.rb
Created March 10, 2013 13:54 — forked from subdigital/test.rb
# based on https://gist.github.com/3349345
# Thanks, @alloy!
#
# To get your project ready for this, you'll have to create a scheme for your unit test project, make sure run is checked in
# the build step, and then delete the Test Host setting.
# Also, make sure you have the colored and open4 gems installed.
require 'rubygems'
require 'colored'
require 'pathname'
@jk
jk / FeatureContext.php
Last active February 14, 2019 16:37 — forked from michalochman/gist:3175175
Take screenshots with Behat + Mink + Selenium2 Stack when a step fails. CAUTION: Work in progress
<?php
use Behat\Behat\Event\StepEvent;
use Behat\Gherkin\Node\StepNode,
Behat\Gherkin\Node\ScenarioNode,
Behat\Gherkin\Node\FeatureNode;
use Behat\Mink\Driver\Selenium2Driver;
/**
@jk
jk / weak.m
Last active December 23, 2015 23:49 — forked from krzysztofzablocki/gist:6711189
- (void)main {
__weak id obj;
// Wrong:
dispatch_async(queue, ^() {
[obj doSomething];
[obj doSomethingElse]; // can turn to nil at any point, should store in strong at beggining of block
[obj doSomethingElse2];
});
UIDevice *device = [UIDevice currentDevice];
SEL selector = NSSelectorFromString([device.systemVersion hasPrefix:@"7"] ? @"_deviceInfoForKey:" : @"deviceInfoForKey:");
NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);