Skip to content

Instantly share code, notes, and snippets.

View carlosmcevilly's full-sized avatar

Carlos McEvilly carlosmcevilly

View GitHub Profile
@pauline2k
pauline2k / gist:3777367
Created September 24, 2012 18:08
The Amazing C UTF-8 validator/XML escaper
#adapted from http://stackoverflow.com/a/2977559
#define IS_IN_RANGE(c, f, l) (((c) >= (f)) && ((c) <= (l)))
int validUTF8(char *text, int *data_offset);
int validUTF8(char *text, int *data_offset)
{
if(data_offset)
*data_offset = 0;
@fduch2k
fduch2k / UIImage+Retina4.h
Created September 24, 2012 08:09 — forked from bstahlhood/UIImage+Retina4.h
Swizzled UIImage imageNamed for iPhone 5
//
// UIImage+Retina4.h
// StunOMatic
//
// Created by Benjamin Stahlhood on 9/12/12.
// Copyright (c) 2012 DS Media Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
@qvivo-tom
qvivo-tom / gist:3773842
Created September 24, 2012 02:14 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
#
# c.f. StackOverflow question/answer here: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.1 (added support for header files in subfolders)
#
# Latest Change:
# - Some libs (e.g. box2D) require their headers in sub-folders; Xcode DOES NOT SUPPORT THIS, but you can hack Xcode to force it to obey the standards. But then this script would fail; this has now been fixed - script works with both types of project
#
# Purpose:
# Create a static library for iPhone from within XCode
@codeswimmer
codeswimmer / disable_warnings.m
Created September 23, 2012 23:44
iOS: How to disable warnings via #pragma
#pragma GCC diagnostic ignored "-Wundeclared-selector"
@superacidjax
superacidjax / gist:3738119
Created September 17, 2012 15:48
Setting up an ideal OS X environment
#note: there is more to this than is listed here.. this is just minimal stuff, if you want to get even more high speed, contact me.
#OS X Named Streams Issue for OSX 10.6
echo "[default]" | sudo tee /etc/nsmb.conf
echo "streams=no" | sudo tee -a /etc/nsmb.conf
Install Homebrew
sudo mkdir /usr/local
@pomeh
pomeh / pr.md
Created September 17, 2012 14:54 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 10, 2024 15:25
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@xslim
xslim / addDebugSettingsChild.sh
Created February 9, 2012 17:22 — forked from daveverwer/build.rb
Scripts to play with Settings.bundle
#!/bin/sh
# addDebugSettingsChild.sh
#
# Simple script to inject a Debug menu in an iPhone Settings plist.
#
# created 10.15.2008 by Andy Mroczkowski, mrox.net
THIS="`basename $0`"
PLISTBUDDY="/usr/libexec/PlistBuddy -x"
#!/usr/bin/env python
import zipfile
import fnmatch
from optparse import OptionParser
parser = OptionParser("usage: %prog archive [file]")
(options, args) = parser.parse_args()
try:
zf = zipfile.ZipFile(args[0])
@weakish
weakish / backup-providers.md
Last active September 28, 2022 06:27
reviews of vps, storage, mail forward