Skip to content

Instantly share code, notes, and snippets.

View roustem's full-sized avatar

Roustem Karimov roustem

View GitHub Profile
@roustem
roustem / gist:1498185
Created December 19, 2011 18:01
TextMate 2 .tm_properties

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

@roustem
roustem / gist:1186829
Created September 1, 2011 18:11
Bug in NSJSONSerialization
//
// main.m
// JSONTrouble
//
// Created by Roustem Karimov on 11-08-31.
// Copyright (c) 2011 AgileBits. All rights reserved.
//
#import <Foundation/Foundation.h>
# Colors from http://wiki.archlinux.org/index.php/Color_Bash_Prompt
# misc
NO_COLOR='\e[0m' #disable any colors
# regular colors
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
BLUE='\e[0;34m'
MAGENTA='\e[0;35m'
@roustem
roustem / ipad2.sh
Created March 24, 2011 18:02
Check for iPad 2 availability in Canadian Apple Store
#! /bin/bash
while [ 1 ]
do
curl -s 'http://store.apple.com/ca/browse/home/shop_ipad/family/ipad/select?mco=MjE2MjYyNzA' | grep -i "Currently unavailable" > /dev/null
if [ $? == 0 ]; then
echo "`date` — not available"
else
echo "`date` — available"
say "iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available!"
break
#import <AddressBook/AddressBook.h>
static NSString* defaultEmail()
{
NSString* result = @"";
@try {
ABPerson *me = [[ABAddressBook sharedAddressBook] me];
if (me == nil) return result;