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 -w | |
use strict; | |
use Foundation; | |
my $plist = NSDictionary->dictionaryWithContentsOfFile_("/Applications/TextEdit.app/Contents/Info.plist"); | |
print $plist->description()->UTF8String(); |
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 Mojolicious::Lite; | |
use Mojo::JSON 'j'; | |
use Mojo::Asset::Memory; | |
use File::Spec; | |
helper send_ready_signal => sub { | |
my $self = shift; | |
my $payload = { ready => \1 }; |
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 Mojolicious::Lite; | |
any '/' => 'index'; | |
websocket '/time' => sub { | |
my $c = shift; | |
my $t = Mojo::IOLoop->recurring( 1 => sub { | |
$c->send( time ); |
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
(function($){ | |
"use strict"; | |
var startY; | |
var defaults = { | |
"$these": [], | |
"touchstartInit": false, | |
"touchmoveInit": false | |
}; |
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
import UIKit | |
import Foundation | |
import XCPlayground | |
XCPSetExecutionShouldContinueIndefinitely() | |
class RemoteAPI { | |
func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void { | |
let url: NSURL = NSURL(string: "http://itunes.apple.com/search?term=Turistforeningen&media=software") | |
let ses = NSURLSession.sharedSession() |
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
## try to add into .bash_profile if you see folowing locale errors | |
################################################################## | |
## perl: warning: Setting locale failed. | |
## perl: warning: Please check that your locale settings: | |
## LANGUAGE = (unset), | |
## LC_ALL = (unset), | |
## LANG = "en_US.UTF-8" | |
## are supported and installed on your system. | |
## perl: warning: Falling back to the standard locale ("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
#!/usr/bin/env perl | |
# cklib | |
# checks if lib is in $path /$ARGV[0]/ | |
use 5.010; | |
use FFI::CheckLib; | |
check_lib_or_exit( lib => 'jpeg', symbol => 'jinit_memory_mgr' ); | |
check_lib_or_exit( lib => [ 'iconv', 'jpeg' ] ); | |
# or prompt for path to library and then: print "where to find jpeg library: "; | |
my $path = <STDIN>; |
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: https://www.instapaper.com/text?u=http%3A%2F%2Fzzapper.co.uk%2Fvimtips.html | |
__BEGIN__ | |
*vimtips.txt* For Vim version 7.3. | |
------------------------------------------------------------------------------ | |
" new items marked [N] , corrected items marked [C] | |
" *best-searching* | |
/joe/e : cursor set to End of match | |
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C] | |
/joe/s-2 : cursor set to Start of match minus 2 | |
/joe/+3 : find joe move cursor 3 lines down |