Skip to content

Instantly share code, notes, and snippets.

// TARGET.pid のファイルを削除で終了
if ( WScript.Count == 0 ) {
WScript.Echo("対象ファイルをD&Dしてください");
WScript.Quit();
}
var TARGET = WScript.Arguments(0);
// バックアップするかチェックする間隔(ミリ秒)
var PERIOD = 60 * 1000;
var AutoBackup = {
#日本語用 形態素解析もどき
#http://ablog.seesaa.net/article/24578324.html
#を移植したものです。とりあえずライセンスは、Creative commonsの表示で。商用利用OKですが、自分の名前を明記してください。
#クレジット:sorah 感謝:http://ablog.seesaa.net/article/24578324.html
#str=形態素解析したい文字列(日本語のみ)
#返却するのは分割された配列。
def morphAnalyzer(str)
s = str.gsub(/([一-龠々〆ヵヶ]+|[ぁ-ん]+|[ァ-ヴー]+|[a-zA-Z0-9]+|[a-zA-Z0-9]+|[,.、。!!??()()「」『』]+|[  ]+)/,"\\1|")
ary = s.split("|")
use strict;
use warnings;
use utf8;
use LWP::UserAgent;
use XML::LibXML;
use Encode;
use Data::Dumper;
my @urls = qw(
http://api.wassr.jp/public_timeline.rss
@hiroyukim
hiroyukim / g91dl.rb
Created August 24, 2009 02:17 — forked from sorah/g91dl.rb
#!/usr/bin/ruby
#-*- coding: utf-8 -*-
require "rubygems"
require "mechanize"
require "hatenaauth.rb"
require "cgi"
####config
params = {
:api_key => "ここにapiキー",
:secret => "ここに秘密鍵"
class Object
def send_through(object, *args)
object.dispatcher_for(self).call(self, *args)
end
end
module Dispatcher
class DispatcherNotFound < StandardError; end
def self.extended(klass)
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common 'POST';
my @file_paths = @ARGV;
my $user_id = q{};
my $passwd = q{};
use strict;
use warnings;
my %hash;
@hash { qw/aaaa bbbb/ } = (0..1);
1 package main
2
3 import "fmt"
4
5 func main () {
6 fmt.Printf("Hello World\n")
7 }
package main
import ( 08 "os"; 09 "flag"; // command line option parser 10 )
var omitNewline = flag.Bool("n", false, "don't print final newline")
const ( 15 Space = " "; 16 Newline = "\n"; 17 )
func main() {
flag.Parse();
@hiroyukim
hiroyukim / gist:924693
Created April 18, 2011 02:09
何日か前のログを消すとか
#!/bin/sh
log_file=`date --date '7 day ago' +"/path/to/%Y%m%d.log"`
if[ -e $log_file ]; then
rm -f $log_file
fi