Skip to content

Instantly share code, notes, and snippets.

View Julioacarrettoni's full-sized avatar
🇦🇷

Julio Carrettoni Julioacarrettoni

🇦🇷
View GitHub Profile
@benpickles
benpickles / ding.sh
Created November 25, 2010 14:33
Make a "ding" sound on your Mac!
# .___.__
# __| _/|__| ____ ____
# / __ | | |/ \ / ___\
# / /_/ | | | | \/ /_/ >
# \____ | |__|___| /\___ /
# \/ \//_____/
#
# Make a "ding" sound on your Mac! Useful for notifying you when a command
# line script has finished.
#
@rconnelly
rconnelly / AppDelegate.m
Created December 20, 2011 07:33
Example of how to set up a stackmob application with restkit.
STMRestKitConfiguration *config = [STMRestKitConfiguration configuration];
// UserModel is a class which implements the STMMappedObject protocol
// this line registers the model
NSArray *mappings = [STMObjectMapping defaultMappingsForClasses:[UserModel class], nil];
[config.mappingProvider registerObjectMappings:mappings];
// create a restkit data provider
id<STMDataProvider> dataProvider = [STMRestkitDataProvider dataProviderWithConfiguration:config];
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@benvium
benvium / installMobileProvisionFile.sh
Created May 1, 2012 15:14
This script installs a .mobileprovision file via bash (no GUI session needed)
#!/bin/sh
# 2012 - Ben Clayton (benvium). Calvium Ltd
# Found at https://gist.github.com/2568707
#
# This script installs a .mobileprovision file without using Xcode. Unlike Xcode, it'll
# work over SSH.
#
# Requires Mac OS X (I'm using 10.7 and Xcode 4.3.2)
#
@jder
jder / Downscaling ALAssets
Last active March 20, 2018 06:51
A method for downscaling ALAssets
// For details, see http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill
#import <AssetsLibrary/AssetsLibrary.h>
#import <ImageIO/ImageIO.h>
// Helper methods for thumbnailForAsset:maxPixelSize:
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) {
ALAssetRepresentation *rep = (__bridge id)info;
NSError *error = nil;
@martinsik
martinsik / MyCalendar.h
Created March 8, 2013 09:47
Example of using EventKit on iOS 6+
#import <Foundation/Foundation.h>
@interface MyCalendar : NSObject
+ (void)requestAccess:(void (^)(BOOL granted, NSError *error))success;
+ (BOOL)addEventAt:(NSDate*)eventDate withTitle:(NSString*)title inLocation:(NSString*)location;
@end
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@staltz
staltz / introrx.md
Last active June 15, 2024 12:24
The introduction to Reactive Programming you've been missing
@bjhomer
bjhomer / pprofile.py
Created June 25, 2014 16:39
A simple python script to more easily inspect provisioning profiles.
#! /usr/bin/python
import sys
import os
def main():
if len(sys.argv) < 2:
print "Usage: profile.py <path> | <UUID>"
sys.exit()
@rrenna
rrenna / gist:ec2fa0dc5707d6ae4411
Last active August 29, 2015 14:10
Example of odd UIAppearance proxy behaviour in iOS 8.1. When implemented this way, the labels used in controls which should be outside the scope of your app, like the iOS share sheet, are also modified.
// Extend UILabel with a method which sets font, to be used by UIAppearance
extension UILabel
{
func setFontName(fontName:String)
{
self.font = UIFont(name: fontName, size: self.font.pointSize)
}
}
// Somewhere in the code, call the extension method on the UIAppearance proxy object of UILabel, example: