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
/* mail.google.com */ | |
table img[title*=".zip" i], table img[title*=".rar" i], table img[title*=".gz" i], table img[title*=".tar" i], table img[title*=".bz2" i] { | |
width:0px!important; height:0px!important; padding-left:16px!important; padding-top:16px!important; background-position: top left !important;background-image: url(https://ssl.gstatic.com/docs/doclist/images/mediatype/icon_1_archive_x16.png) !important; | |
} | |
table img[title*=".txt" i], table img[title*=".rtf" i], table img[title*=".csv" i], table img[title*=".tsv" i] { | |
width:0px!important; height:0px!important; padding-left:16px!important; padding-top:16px!important; background-position: top left !important; background-image:url(https://ssl.gstatic.com/docs/doclist/images/mediatype/icon_1_text_x16.png) !important; | |
} | |
table img[title*=".c" i], table img[title*=".pl" i], table img[title*=".sql" i] { | |
width:0px!important; height:0px!important; padding-left:16px!important; padding-top:16px!important; background-position: top left !important; background- |
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
# -*- coding: utf-8 -*- | |
# See documentation in: | |
# https://doc.scrapy.org/en/latest/topics/commands.html#custom-project-commands | |
from scrapy.commands import ScrapyCommand | |
from scrapy.crawler import CrawlerProcess | |
from scrapy.utils.project import get_project_settings | |
class Command(ScrapyCommand): |
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
sub udcr { | |
my ($X, $Y) = @_; | |
if (scalar(@{$X}) < 2 || scalar(@{$X}) != scalar(@{$Y})) { | |
return; | |
} | |
my $j = 0; | |
for (my $i = 1; $i < scalar(@{$X}); $i++) { | |
my $_x = $X->[$i] - $X->[$i - 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
namespace MecabWrapper | |
{ | |
public class Mecab | |
{ |
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
# indexmaker --columns=1 /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html | |
WorkDir: /var/www/mrtg | |
Target[eth0]: \eth0:private@localhost: | |
SetEnv[eth0]: MRTG_INT_IP="localhost" MRTG_INT_DESCR="eth0" | |
MaxBytes[eth0]: 125000000 | |
Options[eth0]: growright, bits | |
Title[eth0]: eth0 | |
PageTop[eth0]: <h1>eth0</h1> |
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
/IPAGothic << /FileType /TrueType /Path (/usr/share/fonts/ipa-gothic/ipag.ttf) /CSI [(Japan1) 6] >> ; | |
/IPAMincho << /FileType /TrueType /Path (/usr/share/fonts/ipa-mincho/ipam.ttf) /CSI [(Japan1) 6] >> ; | |
/IPAPGothic << /FileType /TrueType /Path (/usr/share/fonts/ipa-pgothic/ipagp.ttf) /CSI [(Japan1) 6] >> ; | |
/IPAPMincho << /FileType /TrueType /Path (/usr/share/fonts/ipa-pmincho/ipamp.ttf) /CSI [(Japan1) 6] >> ; | |
/#82l#82r#20#83S#83V#83b#83N /IPAGothic ; | |
/#82l#82r#83S#83V#83b#83N /IPAGothic ; | |
/@#82l#82r#83S#83V#83b#83N /IPAGothic ; | |
/DFHSGothic-W5 /IPAGothic ; | |
/DFPHSGothic-W5 /IPAGothic ; |
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 strict; | |
use warnings; | |
use CGI; | |
use Net::Twitter; | |
my $cgi = new CGI; |
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
use Data::Pageset; | |
$self->helper( | |
pagination => sub { | |
my ($self, $total_entries, $current_page) = @_; | |
my $dp = Data::Pageset->new({ | |
'total_entries' => $total_entries, | |
'entries_per_page' => 20, | |
'current_page' => (! $current_page || $current_page < 1) ? 1 : $current_page, |
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
use Text::MeCab; | |
our $mecab = Text::MeCab->new({ node_format => "%M" }); | |
sub get_terms { | |
my $str = shift; | |
my @terms; | |
my @surfaces; | |
for (my $node = $mecab->parse($str); $node; $node = $node->next) { | |
my @feature = split /,/, $node->feature; |
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
sub snippet { | |
my ($text, $terms, $max, $tag_s, $tag_e) = @_; | |
utf8::decode($text); | |
if (length($text) < $max) { | |
return $text; | |
} | |
if (! ref($terms)) { |
NewerOlder