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
__weak __typeof__(foo) weakFoo = foo; | |
foo.block = ^ | |
{ | |
[weakFoo doSomething]; | |
}; |
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
#pragma mark - Core Data | |
- (void)setupCoreData | |
{ | |
[MagicalRecord setupAutoMigratingCoreDataStack]; | |
if (SearchEngine.MR_countOfEntities == 0) | |
{ | |
[self importSeeds]; | |
} |
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
'use strict'; | |
// generated on 2014-08-08 using generator-gulp-webapp 0.1.0 | |
var gulp = require('gulp'); | |
// load plugins | |
var $ = require('gulp-load-plugins')(); | |
var mainBowerFiles = require('main-bower-files'); | |
// config |
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
for gem in $(gem list | cut -d" " -f1); do gem uninstall -aIx $gem; done |
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
<?php | |
preg_match_all('/<img src="([^"]+)_SM.jpg"/i', file_get_contents($argv[1]), $matches); | |
foreach ($matches[1] as $key => $match) | |
{ | |
$infile = $match.'_BG.jpg'; | |
if ($data = file_get_contents($infile)) | |
{ |
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 php | |
<?php | |
# execute as nightly cronjob | |
# redirect to /dev/null if you don't want get mailed errors because WoW is running | |
# use with Elephant (or similar) addon that automatically enables writing to WoWChatLog.txt | |
$source_path = "/Applications/Games/World of Warcraft/Logs"; | |
$dest_path = '/Users/david/Documents/Logs/WoW'; |
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
<?php | |
/** | |
* reorders an array based on the specified order of keys. | |
* | |
* @param array $array the array that should be reordered | |
* @param array $order the order that the keys in the first array should be in. each value should be a key from the first array. any elements from the first array that are not specified in the order will be inserted at the end of the returned array, in their original order. | |
* | |
* @return array | |
*/ |
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 bash | |
# config | |
date=`date "+%Y-%m-%d"` | |
git_binary=/usr/local/bin/git | |
# repositories in /git, space-separated. | |
repos="foo.git bar.git" |
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
<?php | |
/** | |
* get current git revision | |
*/ | |
if (sfConfig::get('sf_environment') != 'prod' && file_exists(sfConfig::get('sf_root_dir').'/../.git/logs/HEAD')) | |
{ | |
$fp = fopen(sfConfig::get('sf_root_dir').'/../.git/logs/HEAD', 'r'); | |
$pos = -2; $line = ''; $c = ''; |
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
#!/bin/bash | |
# Apple has informed me that you should not use Time Machine for backing up a server. | |
# (Why it remains an option in System Preferences, despite not working correctly, is a mystery to me.) | |
# For further information, see Advanced_Server_Admin_v10.6.pdf, page 36. | |
# If you still want this script for some reason, see past revisions. |
OlderNewer