Skip to content

Instantly share code, notes, and snippets.

View roustem's full-sized avatar

Roustem Karimov roustem

View GitHub Profile
@roustem
roustem / vm-setup.sh
Last active August 29, 2015 14:16 — forked from nf/vm-setup.sh
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
{
"always_show_minimap_viewport": true,
"binary_file_patterns":
[
"*.d.ts"
],
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow.tmTheme",
"detect_indentation": false,
"draw_minimap_border": true,
"folder_exclude_patterns":
@roustem
roustem / gist:3664276aed9fb7e8fc4d
Last active August 29, 2015 14:20
Sublime Text Key Bindings
[
{
"keys" : ["cmd+>"],
"command" : "nextBuildError"
},
{
"keys" : ["cmd+<"],
"command" : "prevBuildError"
},
@roustem
roustem / TypeScript.sublime-settings
Last active August 29, 2015 14:20
Packages/User/TypeScript.sublime-settings
{
"translate_spaces_to_tabs": true,
"translate_tabs_to_spaces": false,
"use_tab_stops": true
}
#import <AddressBook/AddressBook.h>
static NSString* defaultEmail()
{
NSString* result = @"";
@try {
ABPerson *me = [[ABAddressBook sharedAddressBook] me];
if (me == nil) return result;
@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
# 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 / 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>
@roustem
roustem / run_onepassword_beta.rb
Created January 19, 2012 19:20
run_onepassword_beta.rb
#!/usr/bin/env ruby
BETA_URL = "http://i.agilebits.com/dist/1P/mas/1PasswordBeta.app.zip"
local_timestamp_filename = File.expand_path("~/.onepassword_beta_timestamp")
last_modified_local = ""
if File.exists?("/Applications/1PasswordBeta.app")
File.open(local_timestamp_filename, "r") { |f| last_modified_local = f.read() } rescue nil
end
@roustem
roustem / gist:2022128
Created March 12, 2012 14:04 — forked from rcw3/gist:2018059
Self-contained WWDC Status Checker Hack
#!/bin/bash
#
# add to crontab
# */5 * * * * /Users/YOURNAME/bin/wwdc >/dev/null
#
# URL="http://www.cnn.com"
URL="http://developer.apple.com/wwdc/"