Skip to content

Instantly share code, notes, and snippets.

@raa0121
raa0121 / rename_file.cs
Created December 24, 2011 01:52
html実体参照なファイル名をリネームするC#
using System;
using System.Collections.Generic;
using System.Text;
//VisualStudioで実行する際、参照設定に"System.Web"を追加してください。
//ソリューションエクスプローラの参照設定を右クリック→参照の追加→".NET"のタブ→"System.Web"→"OK"
namespace rename_file
{
class Program
{
#!/use/bin/env ruby
require 'cgi'
require 'json'
json = JSON.parse(CGI.new["json"])
x,y = IO.pipe
print "Content-Type: text/plain\n\n"
json["events"].each do |e|
system'yaourt', '-Ss', e["messege"]["text"], out: x
@raa0121
raa0121 / log
Created May 16, 2012 09:47
BCDice例外
ThreadError
thread 0x270c1f8 tried to join itself
rubygems.rb:840:in `synchronize'
rubygems.rb:840:in `searcher'
rubygems/custom_require.rb:34:in `require'
rubygems/config_file.rb:220:in `load_file'
rubygems/config_file.rb:168:in `initialize'
rubygems.rb:385:in `new'
@raa0121
raa0121 / livecomment.rb
Created May 25, 2012 11:40
firefoxのCookieを拾ってニコ生からコメントを拾うRubyスクリプト for Win
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
if RUBY_VERSION < '1.9'
require 'rubygems'
require 'kconv'
end
require 'mechanize'
require 'rexml/document'
require 'socket'
@raa0121
raa0121 / foooo.rb
Created June 6, 2012 09:58
FooooScriptインタプリタっぽいもの
#/usr/bin/env ruby
# code:utf-8
def foooo
File::open(ARGV[0]){|f|
f.each do |line|
unless(/fo+/i =~ line)
print "Error"
else
print "foooo"
end
@raa0121
raa0121 / Program.cs
Created June 7, 2012 06:57
FooooScriptのインタプリタっぽいものC#
using System;
using System.Collections;
using System.Text;
using System.IO;
namespace FooooScritpt
{
class Program
{
static void Main(string[] args)
@raa0121
raa0121 / .bashrc
Created June 13, 2012 07:54
.bashrcでのCygwinとMinGWの見分け方 ref: http://qiita.com/items/9c39b405444c92aae631
_bash=`which vim`
if test _bash = "/usr/bin/bash" ; then
LANG=ja_JP.UTF-8
elif test _bash = "/usr/bin/bash.exe" ; then
LANG=ja_JP.sjis
JLESSCHARSET="japanese-sjis"
OUTPUT_CHARSET=sjis
fi
@raa0121
raa0121 / Gvim.vbs
Created June 20, 2012 01:44
Win32なGvimをMinGWShellでコマンドを打たずに起動する方法 ref: http://qiita.com/items/63f9eaeafb3982693fae
Option Explicit
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "C:\MinGW\msys\1.0\bin\bash.exe -c 'source ~/.bashrc; gvim' &"
Set oShell = Nothing
@raa0121
raa0121 / Nicovideo.rb
Created July 25, 2012 22:00
ニコニコ動画の検索APIで特定のタグの投稿の新しい順に検索し、情報を拾ってくるスクリプト
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
if RUBY_VERSION < '1.9'
require 'rubygems'
end
require 'json'
require 'mechanize'
require 'cgi'
if RUBY_VERSION < '1.9'
require 'rubygems'
end
require 'sinatra'
require 'json'
def sandbox(&code)
proc {
$SAFE = 2
eval &code