This file contains hidden or 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
| - (void)displayError:(NSError *)error | |
| { | |
| [self displayAlertWithTitle:@"Error" message:[error description]]; | |
| } | |
| - (void)displayAlertWithTitle:(NSString *)title message:(NSString *)message | |
| { | |
| UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title | |
| message:message | |
| delegate:nil |
This file contains hidden or 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
| #CSS | |
| body:after { | |
| position: absolute; | |
| width: 0; | |
| height: 0; | |
| overflow: hidden; | |
| visibility: hidden; | |
| } | |
| @media (max-width: 768px) { |
This file contains hidden or 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
| class FluidVideos | |
| @init: (container=null, $videos=null) -> | |
| $videos ||= $("iframe[src*='vimeo.com'], iframe[src*='youtube.com']") | |
| $videos.each -> | |
| $(this) | |
| .data('aspectRatio', this.height/this.width) | |
| .removeAttr('height') | |
| .removeAttr('width') |
This file contains hidden or 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
| class Tableless | |
| include ActiveModel::Validations | |
| include ActiveModel::Conversion | |
| extend ActiveModel::Naming | |
| attr_accessor :new_record | |
| def initialize(attributes={}) | |
| self.new_record = attributes.blank? | |
| attributes && attributes.each do |name, value| |
This file contains hidden or 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
| .valign-outer { | |
| &::before { | |
| content: ''; | |
| display: inline-block; | |
| height: 100%; | |
| vertical-align: middle; | |
| margin-right: -0.3em; //adjusts for spacing | |
| } | |
| .valign-inner { |
This file contains hidden or 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
| public static $instance; | |
| public static function get_instance() { | |
| $class = get_class(this); | |
| if(!self::$instance) | |
| self::$instance = new $class(); | |
| return self::$instance; | |
| } |
This file contains hidden or 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
| (function () { | |
| var width = 320; //default to non-retina iPhone | |
| var height = 460; | |
| if(navigator.platform === 'iPad') { | |
| if(window.orientation === 90 || window.orientation === -90) { | |
| width = 1024; //landscape | |
| height = 748; | |
| } | |
| else { |
This file contains hidden or 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
| tell application "System Events" | |
| set itunesRunning to count of (every process whose name is "iTunes") | |
| if itunesRunning is 0 then return | |
| end tell | |
| tell application "iTunes" | |
| if player state is stopped then return | |
| set shows to {{title:"Hypercritical", slug:"hypercritical"}, {title:"The Talk Show", slug:"talkshow"}, {title:"Build and Analyze", slug:"buildanalyze"}, {title:"After Dark", slug:"afterdark"}, {title:"The Pipeline", slug:"pipeline"}, {title:"5by5 Specials", slug:"specials"}, {title:"Back To Work", slug:"b2w"}, {title:"Mac Power Users", slug:"mpu"}, {title:"The Incomparable", slug:"incomparable"}, {title:"The Cocktail Napkin", slug:"tcn"}, {title:"Latest in Paleo", slug:"paleo"}, {title:"Critical Path", slug:"criticalpath"}, {title:"The Big Web Show", slug:"bigwebshow"}, {title:"Content Talks", slug:"contenttalks"}, {title:"Founders Talk", slug:"founderstalk"}, {title:"The Ihnatko Almanac", slug:"ia"}, {title:"Geek Friday", slug:"geekfriday"}, {title:"Internet Superhero", slug:"superhero"}, {title |
This file contains hidden or 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
| tell application "Safari" to set currentURL to URL of current tab of window 1 | |
| tell application "Google Chrome" | |
| activate | |
| delay 0.2 | |
| if (exists window 1) and (URL of active tab of window 1 is "chrome://newtab/") then | |
| tell window 1 to set URL of active tab to currentURL | |
| else | |
| open location currentURL | |
| end if | |
| end tell |
This file contains hidden or 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
| if [ `defaults read com.apple.finder AppleShowAllFiles` == 1 ] | |
| then | |
| defaults write com.apple.finder AppleShowAllFiles -bool false | |
| else | |
| defaults write com.apple.finder AppleShowAllFiles -bool true | |
| fi | |
| killall Finder |
OlderNewer