Here is a checklist to follow if you want maximum battery life -- for instance if you're about to get on a long plane flight.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An API keys script written by Patrick Gibson (@patr1ck) and Christopher Bowns (@cbowns) | |
# This script sets API keys in your app's Info.plist from an .api_keys file you keep in your home directory (~/.api_keys) | |
# This allows you to not check API keys into your source control system, | |
# or for different developers to use different keys without needing to patch their working copies. | |
# Installation directions: | |
=begin | |
1. Create a Run Script build phase in your Xcode project before Compile Sources | |
2. Copy and paste this whole script in. | |
3. Create or modify your .api_keys file to hold your API keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim color file | |
" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration) | |
set background=dark | |
highlight clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# This script converts xccolorthemes to dtvcolorthemes for porting xcode 3.x themes to xcode 4.x | |
# created by ashley towns <[email protected]> | |
# Public domain. | |
# ./dvtcolorconvert <inputfile> | |
# spits out a .dtvcolortheme file | |
require 'plist' | |
raise "Error: need a source file #{__FILE__} [file.xccolortheme]" if ARGV.length == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* bewbs.c: In goes the bewbs, out goes the C! | |
* By: Jean-Nicolas Jolivet,(c)2010 | |
* (.)(.) ++ptr | |
* (.){.} --ptr | |
* (.)[.] ++*ptr | |
* [.](.) -- *ptr | |
* [.][.] putchar(*ptr) | |
* {.}{.} *ptr=getchar() | |
* {.}[.] while(*ptr) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0.052 0.489 0.482 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Menlo-Bold - 11.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0.432 0.325 0.276 1</string> |
An Unordered and Incomplete List of Things You Should Probably Never Use/Do in Ruby
(thanks to Zach Drayer and Ben Stiglitz for their feedback)
- Don't use the implicit
$_
style parameters where any reasonably sane person might expect a parameter, like#puts
. - Don't use the string-manipulation methods included in Kernel, like
chomp
,chop
,sub
, andgsub
. Call them on String instances instead. If you use these methods in combination with$_
style parameters, you are why we can't have nice things. - Don't use
callcc
, because it's inefficient, leaks like a sieve, and isn't included in most implementations. - Don't call
Array#pack
orString#unpack
to store data. YAML/Marshal are more powerful and miles saner. - Don't use
Kernel#test
. Come on, this isn't Perl. Compare the fields of File.stat instead. - Don't use
Kernel#syscall
orIO#syscall
. You shouldn't even do this in C.