source: http://twishort.com/An8cc
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
@interface MyWebViewController : NSObject | |
@property IBOutlet WebView *webView; // nib 内の WebView に接続済みということで | |
@end | |
@implementation MyWebViewController <WebResourceLoadDelegate> | |
- (void)awakeFromNib { | |
// WebView にデリゲートを接続 | |
self.webView.resourceLoadDelegate = self; | |
} |
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 perl | |
use 5.014; | |
use warnings; | |
use Getopt::Long; | |
GetOptions( | |
'dry-run|n' => \my $opt_dry_run, | |
'force|f' => \my $opt_force, | |
); |
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 | |
puts "1" | |
puts "1" | |
puts "1" | |
puts "1" | |
puts "1" | |
print "\e[3A" | |
print "\e[3M" | |
abort |
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
source :rubygems | |
gem 'thin' | |
gem 'sinatra' | |
gem 'sinatra-flash', require: 'sinatra/flash' | |
gem 'slim' | |
gem 'twitter' | |
gem 'omniauth' | |
gem 'omniauth-twitter' |
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 zsh | |
if [[ $# -lt 2 ]]; then | |
print -P "%UUsage%u: brew install-version [install options] FORMULA VERSION" | |
exit 1 | |
fi | |
formula= | |
version= | |
install_opts=() |
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 v6; | |
class T { | |
has $!foo = 'foo'; | |
has $.bar = 'bar'; | |
method new($i) { | |
self.bless(*, foo => $i, bar => $i); | |
} |
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/perl | |
use 5.008; | |
use strict; | |
use warnings; | |
use Cwd 'realpath'; | |
use File::Basename 'basename'; | |
use Getopt::Long; |
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 perl | |
use 5.014; | |
use warnings; | |
use Getopt::Long; | |
GetOptions( | |
'dry-run|n' => \my $opt_dry_run, | |
'force|f' => \my $opt_force, | |
); |
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 v6; | |
sub section(|$c) { print '-- '; say($c); } | |
section 'WHAT is a parcel'; | |
((1, 2), (3, 4)).WHAT.say; # Parcel() | |
((1, 2), (3, 4)).elems.say; # 2 | |
section 'WHAT is a parcel-in-list-context'; | |
list((1, 2), (3, 4)).WHAT.say; # List() |