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 Errno; | |
use IO::Socket::INET; | |
my $sock = IO::Socket::INET->new( | |
LocalPort => 6666, | |
ReuseAddr => 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
package scratch; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
import java.util.Arrays; | |
public class ProxySample { |
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
hist() { | |
local sortopts1= sortopts2= | |
while [[ $# != 0 && "$1" == -* ]]; do | |
if [ "$1" = -r ]; then | |
sortopts2=-r | |
elif [ "$1" = -n ]; then | |
sortopts1=-n | |
elif [[ "$1" = -rn || "$1" = -nr ]]; then | |
sortopts1=-n sortopts2=-r | |
else |
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
public class Eep { | |
class Foo { | |
final int bar; | |
Foo() { | |
Eep.this.foo = this; | |
if (true) { | |
throw new RuntimeException("lolol"); | |
} | |
bar = 42; |
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
$USER = '[email protected]'; | |
$PASS = 'abc123'; |
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
fgrep() { | |
# Parse options | |
local dashv=0 dashq=0 dashx=0 opt= OPTIND=1 | |
local usage=' | |
echo "Usage: fgrep [-vqx] string" >&2; | |
return 1; | |
' | |
while getopts "vqx" opt; do | |
case "$opt" 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
quicksort lst = case lst of | |
pivot:rest -> (quicksort less) ++ [pivot] ++ (quicksort grtr) where | |
less = filter (<= pivot) rest | |
grtr = filter (> pivot) rest | |
empty -> empty |
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 5.012; | |
use XML::XPath; | |
my $xp = XML::XPath->new(filename => 'blist.xml'); |
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
<?php | |
$a = "blah blah blah --"; | |
$b = "img src=http://jesnetplus.com/evil.js width=400 height=400 alt=hi"; | |
?> | |
<!DOCTYPE html> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Broken</title> |
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 open qw(:utf8 :std); | |
use HTML::TreeBuilder; | |
use XML::XPath; | |
use HTML::Entities; | |
use Text::CSV; |