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
(function(){ | |
var d=document; | |
var a=d.querySelectorAll('.anchor_super'); | |
for(var i=0;i<a.length;i++){ | |
var href = a[i].getAttribute("href"); | |
var elem = href.split(/[\?\&]/); | |
var wiki = elem[0]; | |
var page = elem[2].split('=')[1]; | |
var hid = elem[3].split('=')[1]; | |
var ne = d.createElement('a'); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
class Array | |
def xshuffle | |
a = (0...size).to_a | |
a.shuffle! | |
ret = Array.new(size) | |
(0...size).each do |ii| | |
ret[a[ii]] = self[a[(ii + 1) % size]] | |
end | |
ret | |
end |
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
echo off | |
echo $Header: RCS/autoexec.bat 2.25 92/04/05 21:45:04 suchi Exp $ | |
verify on | |
a:\os\utl\fcolor w | |
a:\os\utl\funkey -f a:\os\help\funkey.def | |
a:\os\utl\now | |
a:\os\utl\ee /r a:\os\help\env.dat | |
if exist $$INIT1 goto normal | |
if exist $$INIT2 goto window | |
if exist $$INIT3 goto sel |
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
files=30 | |
buffers=20 | |
shell=a:\command.com a:\ /p /e:1024 | |
device=a:\os\sys\cinit.sys -kt | |
lastdrive=1 Normal | |
device=a:\os\utl\hsb.exe Q V Y- | |
device=a:\win30\himem.sys | |
device=a:\os\sys\emm4j.sys /NN | |
device=a:\win30\ramdisk.sys 1024 512 | |
device=a:\win30\smartdrv.sys 2048 256 |
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
<% ActionController::Routing.possible_controllers.sort.each {|c| %> | |
<%= link_to c.gsub(/^admin\//, "").camelize, :controller => c.to_sym %> | | |
<% } %> |
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
: YYYYMMDD.HHMMSSを作成する | |
: うしろ3桁をカット | |
set TIMEHHMMSS0=%TIME:~0,-3% | |
: ':'を削除 | |
set TIMEHHMMSS=%TIMEHHMMSS0::=% | |
: '/'を削除 | |
set DATEYYYYMMDD=%DATE:/=% | |
set DATETIME=%DATEYYYYMMDD%.%TIMEHHMMSS% | |
: ' 'を0にする | |
set DATETIME=%DATETIME: =0% |
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
require 'open-uri' | |
WAIT = 180 | |
loop do | |
begin | |
open('http://onlineshop.mb.softbank.jp/ols/html/model/ipad/') | |
puts "iPad2 online shop page opened!" | |
rescue Exception => e | |
unless e.to_s =~ /^403/ | |
puts "iPad2 online shop status changed #{e}" | |
end |
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
class Foo | |
include Comparable | |
def initialize(x, y) | |
@x = x | |
@y = y | |
end | |
def <=>(rhs) | |
return nil unless rhs.instance_of? Foo |
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
#include <stdio.h> | |
#include <ctype.h> | |
typedef unsigned char uchar; | |
struct wc { | |
enum wctype { | |
KANJI, // 0 | |
HIRAKATA, // 1 | |
PUNKT, // 2 |
OlderNewer