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
/* PoP 3 Markov Chain in C# */ | |
/* 2003/02/17: suchi -- */ | |
using System; | |
using System.IO; | |
using System.Collections; | |
using System.Text.RegularExpressions; | |
class Prefix { | |
const int MULTIPLIER = 31; // for hashcode |
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 |
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
copy(vs.begin(), vs.end(), ostream_iterator<string>(cout, "\n")); |
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
if ['2.3.8', '2.3.9', '2.3.10', '2.3.11'].include?(Rails.version) && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel) | |
# Pulled right from latest rack. Old looked like this in 1.1.0 version. | |
# | |
# def [](k) | |
# super(@names[k] ||= @names[k.downcase]) | |
# end | |
# | |
module Rack | |
module Utils |
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
// ==UserScript== | |
// @name ShiawaseDojo Permlinker | |
// @namespace SDP | |
// @description ShiawaseDojo Permlinker | |
// @include http://www.htb.co.jp/announcers/mami/* | |
// ==/UserScript== | |
d=document,e=d.querySelectorAll('.entry-date'),a=d.querySelectorAll('a[name*="entry_"]');for(i=0;i<a.length;i++){a[i].appendChild(e[i]);a[i].href='#'+a[i].name}void(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
#include <stdio.h> | |
#define _USE_MATH_DEFINES 1 | |
#include <math.h> | |
int main() | |
{ | |
int n = 1; | |
double d = M_PI; | |
printf("%d %f\n", d, n); |
OlderNewer