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
| function cd! { | |
| mkdir $1 | |
| cd $1 | |
| } |
| [user] | |
| name = Horia Dragomir | |
| email = [email protected] | |
| [github] | |
| user = hdragomir | |
| [alias] | |
| st = status -sb | |
| ci = commit | |
| co = checkout | |
| p = push |
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 | |
| $thumbnail_width = 593; | |
| $thumbnail_height = 400; | |
| foreach(query_posts('posts_per_page=-1') as $post) | |
| if(! has_post_thumbnail($post->ID)) | |
| foreach(get_children('post_type=attachment&post_mime_type=image&post_parent=' . $post->ID) as $image){ | |
| $sizes = wp_get_attachment_metadata($image->ID); | |
| if($sizes['height'] >= $thumbnail_height && $sizes['width'] >= $thumbnail_width){ | |
| set_post_thumbnail($post->ID, $image->ID); |
| $.fn.hint = function(hint){ | |
| var val = $(this).eq(0).bind('focus', function(){ | |
| $(this).removeClass('hinting'); | |
| if($(this).val() == hint) $(this).val(''); | |
| }).bind('blur', function(){ | |
| if($(this).val() == '') $(this).addClass('hinting').val(hint); | |
| }).bind('change', function(){ | |
| $(this).removeClass('hinting'); | |
| }).val(); | |
| if(! /\S/.test(val)) $(this).eq(0).val(hint).addClass('hinting'); |
| $('.some-snazzy-selector').click(function(ev){ | |
| if( ev.which == 2 || ev.metaKey || ev.ctrlKey || ev.shiftKey ){ | |
| return true; | |
| } | |
| // Ajax Magic here | |
| }); |
| (function($){ | |
| $.fn.parseData = function(){ | |
| return $(this).filter('[js-data]').each(function(){ | |
| var data = jQuery.parseJSON($(this).attr('js-data')), prop; | |
| for(prop in data) | |
| $(this).data(prop, data[prop]); | |
| }).end(); | |
| } | |
| })(jQuery); |
| (function($){ | |
| $.fn.redraw = function(){ | |
| return $(this).each(function(){ | |
| var n = document.createTextNode(' '); | |
| $(this).append(n); | |
| setTimeout(function(){n.parentNode.removeChild(n)}, 0); | |
| }); | |
| } | |
| })(jQuery) |
| (function($){ | |
| $.fn.kidFader = function(){ | |
| return $(this).each(function(){ | |
| $(this).hover(function(){ | |
| $(this) | |
| .children('.hover').stop(1,1).hide().fadeIn('fast') | |
| .end() | |
| .children('.normal').stop(1,1).fadeOut('fast'); | |
| }, function(){ |