Skip to content

Instantly share code, notes, and snippets.

View minuscorp's full-sized avatar
:shipit:
It did compile on my computer

Jorge Revuelta minuscorp

:shipit:
It did compile on my computer
View GitHub Profile
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@MacLemon
MacLemon / versioning.sh
Created December 9, 2012 23:22
Autoincreasing Build numbers, get version numbers from git tag, put it into Info.plist
#!/bin/bash
# by Andreas Monitzer (@anlumo1) and Pepi Zawodsky (@MacLemon)
#
# This script published under WTF license
# http://en.wikipedia.org/wiki/WTFPL
# Improvements to this script are welcome though.
# Augments the Info.plist with a lot of nice stuff.
# It's suggested to call this script from a "run script" build phase, not copy the script's contents there.
@willurd
willurd / web-servers.md
Last active June 30, 2024 03:01
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@stig
stig / GitBundleVersionHook
Created August 10, 2013 09:11
Short script to set CFBundleShortVersionString from the latest tag + CFBundleVersion from the number of commits on the master branch. It is useful to use with Jenkins, and doesn't require you to update the repository, so you don't pollute your change history with "updated version" commits.
#!/bin/sh
# This script automatically sets the version and short version string of an
# Xcode project from the Git repository containing the project.
#
# To use this script in Xcode 4, add the contents to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@lfender6445
lfender6445 / gist:9919357
Last active June 23, 2024 09:14
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@miguelcma
miguelcma / DeviceUID.m
Created May 25, 2015 15:09
iOS Unique Device ID that persists between app reinstalls
/* DeviceUID.h
#import <Foundation/Foundation.h>
@interface DeviceUID : NSObject
+ (NSString *)uid;
@end
*/
// Device.m
@samritchie
samritchie / gist:01d75d19639dc576a502
Created May 30, 2015 02:09
Basic Alamofire RAC extension
/**
* Adapted from https://github.com/indragiek/AlamofireRACExtensions
*/
public func get<T>(url: String, f: (AnyObject -> Result<T, NSError>)) -> SignalProducer<T, NSError> {
return SignalProducer { sink, disposable in
let request = Alamofire.request(.GET, hostname + url)
.responseJSON { (request, response, responseObject, error) in
if let error = error {
sendError(sink, error)
} else if let response = response {
@Jerrot
Jerrot / ArrayTransform.swift
Last active March 17, 2024 13:10
Transform arrays with ObjectMapper to Realm's List type
// Based on Swift 1.2, ObjectMapper 0.15, RealmSwift 0.94.1
// Author: Timo Wälisch <timo@waelisch.de>
import UIKit
import RealmSwift
import ObjectMapper
import SwiftyJSON
class ArrayTransform<T:RealmSwift.Object where T:Mappable> : TransformType {
typealias Object = List<T>
//
// Signal+Extensions.swift
// Khan Academy
//
// Created by Nacho Soto on 10/1/15.
// Copyright © 2015 Khan Academy. All rights reserved.
//
import ReactiveCocoa