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
/** | |
* Convenience method to create a MediaPlayer for a given resource id. | |
* On success, {@link #prepare()} will already have been called and must not be called again. | |
* <p>When done with the MediaPlayer, you should call {@link #release()}, | |
* to free the resources. If not released, too many MediaPlayer instances will | |
* result in an exception.</p> | |
* | |
* @param context the Context to use | |
* @param resid the raw resource id (<var>R.raw.<something></var>) for | |
* the resource to use as the datasource |
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 JSON; | |
my $json = JSON->new; | |
undef $/; | |
while (<>) { | |
print $json->pretty->encode($json->decode($_)); | |
} |
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 strict; | |
use warnings; | |
use Time::HiRes 'usleep'; | |
while (1) { | |
open my $in, '<', '/proc/sys/kernel/random/entropy_avail' or die; | |
print <$in>; | |
close $in; |
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/local/bin/perl | |
use strict; | |
use warnings; | |
use Encode; | |
use IsUTF8 'isUTF8'; | |
binmode(STDIN); | |
binmode(STDOUT); | |
binmode(STDERR); |
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
--- edit-server.orig 2010-01-04 20:13:01.000000000 -0700 | |
+++ edit-server 2010-01-04 20:12:34.000000000 -0700 | |
@@ -73,7 +73,7 @@ | |
} | |
my $len = $header{'content-length'}; | |
- unless ($len) { | |
+ unless (length $len) { | |
http_header($fh, 500, 'Invalid request -- no content-length.'); | |
close $fh; |
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 | |
# A simple web server that just listens for textarea filter requests | |
# and runs an editor to manipulate the text. Is intended to be | |
# used with the TextAid extention for Chrome. | |
use strict; | |
use warnings; | |
use threads; | |
use threads::shared; | |
use Socket; |
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 | |
# Gmail notes converter | |
# by Jon Jensen <[email protected]> | |
# 2009-07-20 | |
# Copyright 2009 Jon Jensen. Distributed under the GPLv3 license. | |
# For details see http://www.gnu.org/licenses/gpl-3.0.html | |
# When importing e.g. Nokia phone contacts into Gmail, most fields are |
NewerOlder