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
<!DOCTYPE html> | |
<html lang="en-us" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" /> |
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
duckduckgo url settings: | |
kp - safe search -1 == off | |
kl - set region us-en == USA | |
kc - auto load more results -1 == off | |
kf - favicons -1 == off | |
kb - embeds n == none | |
kv - page numbers 1 == on | |
k4 - sidebar -1 == off |
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
#!/usr/bin/perl | |
use utf8; | |
use v5.10; | |
use warnings; | |
use File::Spec; | |
if ( $#ARGV == -1 ) { | |
say 'Usage: fix_dirs.pl [FILE]'; | |
exit; |
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
mkdir -p ~/.history | |
shopt -s histappend | |
shopt -s cmdhist | |
export HISTFILE=~/.history/`date +%Y-%m-%d`.hist | |
PROMPT_COMMAND="history -n;history -a" |
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
#!/usr/bin/perl | |
use 5.014; | |
use warnings; | |
use autodie; | |
use utf8::all; | |
use IO::All; | |
die 'No input file specified.' if ( $#ARGV == -1 ); |
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
#!/usr/bin/perl | |
use 5.014; | |
use warnings; | |
use autodie; | |
use utf8::all; | |
use IO::All; | |
die 'No input file specified.' if ( $#ARGV == -1 ); |
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
#!/usr/bin/perl | |
use v5.14; | |
use warnings; | |
use utf8::all; | |
use autodie; | |
open my $source, '<', 'dracula.txt'; | |
foreach my $line (<$source>) { |
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
#!/usr/bin/perl | |
use v5.14; | |
use warnings; | |
use autodie; | |
use utf8::all; | |
open my $source, '<', 'dracula.txt'; | |
foreach my $line (<$source>) { |
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
next if content =~ />#{username}</ # skip if we posted it | |
next unless post.inner_html =~ /vote/ # skip if it's not a post | |
id = content[/\_(\d+)/,1] | |
comment_text = (post/'.comment').first.inner_text | |
commenter = content[/user\?id=(\w+)/,1] |
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
# The following regexp will break | |
indentation = '<img src="http:\/\/ycombinator.com\/images\/s.gif" height=1 width=(\d+)><\/td>' | |
score = '<span id=score_([0-9]+)>([0-9]+) point' | |
user_id = '<a href="user\\?id=([^"]+)">' | |
time_ago = '<\/a>([^\|]+)\|' | |
comment_body = '<span class=\\"comment\\"><font color=#000000>(.*?)<\\/font>' | |
regexp_str = "#{indentation}.*?#{score}.*?#{user_id}.*?#{time_ago}.*?#{comment_body}" |