This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
RewriteEngine On | |
RewriteRule ^([a-zA-Z0-9\-\_]+)([\/]*)$ /#\/$1 [R=301,L,NE] |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<?php | |
/* From http://stackoverflow.com/questions/5039494/yii-ajax-button-how-to-prevent-multiple-js-onclick-bindings */ | |
echo CHtml::submitButton($diary->isNewRecord ? 'Создать' : 'Сохранить', array('id' => 'newRecSubmit')); | |
Yii::app()->clientScript->registerScript('btnNewRec', " | |
var clickNewRec = function() | |
{ | |
jQuery.ajax({ | |
'success': function(data) { | |
$('#ui-tabs-1').empty(); | |
$('#ui-tabs-1').append(data); |
# Originally from https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Enable the 2D Dock | |
defaults write com.apple.dock no-glass -bool true | |
# Disable menu bar transparency | |
defaults write -g AppleEnableMenuBarTransparency -bool false | |
# Expand save panel by default | |
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true |
RewriteEngine On | |
RewriteRule ^/(.*)$ http://www.newdomain.com [R=301,L] |
# Remove the last character of each line in the file: | |
:%s/.$// |
@interface ViewController | |
@end | |
@implementation ViewController | |
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
[firstControl resignFirstResponder]; | |
[secondControl resignFirstResponder]; | |
[thirdControl resignFirstResponder]; | |
// ... | |
} |
// (http://stackoverflow.com/questions/410471/how-can-i-pop-a-view-from-a-uinavigationcontroller-and-replace-it-with-another-i) | |
// locally store the navigation controller since | |
// self.navigationController will be nil once we are popped | |
UINavigationController *navController = self.navigationController; | |
/* Not necessary with ARC | |
// retain ourselves so that the controller will still exist once it's popped off | |
[[self retain] autorelease]; | |
*/ |
grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl |
Paul Stefan Ort, @PaulStefanOrt
Def Method, Dependable port@dependable.io