Skip to content

Instantly share code, notes, and snippets.

View joker1007's full-sized avatar

Tomohiro Hashidate joker1007

View GitHub Profile
diff -r f6cacdc34495 src/Makefile
--- a/src/Makefile Wed Aug 07 21:13:23 2013 +0200
+++ b/src/Makefile Sun Aug 11 16:00:41 2013 +0900
@@ -1483,6 +1483,7 @@
$(PYTHON_SRC) $(PYTHON3_SRC) \
$(TCL_SRC) \
$(RUBY_SRC) \
+ $(MRUBY_SRC) \
$(SNIFF_SRC) \
$(WORKSHOP_SRC) \
Earthquake.init do
output do |item|
next unless item['text']
next unless config[:separator]
unless config[:screen_width]
begin
require 'curses'
screen = Curses.init_screen
config[:screen_width] = screen.maxx
class SampleResolver < ActionView::Resolver
include Singleton
def find_templates(name, prefix, partial, details)
scope = details[:database] # ActiveRecord::Relation
scope.map(&:to_template)
end
end
class Template < ActiveRecord::Base
install
cdrom
lang ja_JP.UTF-8
keyboard us
network --bootproto=dhcp
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Asia/Tokyo
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
input_dir = ARGV[0]
Dir.chdir(input_dir)
mka_files = Dir.glob("*.mka")
mka_files.each do |filename|
basename = File.basename(filename, ".*")
unless File.exist?(basename)
Dir.mkdir(basename)
input_dir = ARGV[0]
Dir.chdir(input_dir)
mka_files = Dir.glob("*.mka")
mka_files.each do |filename|
basename = File.basename(filename, ".*")
unless File.exist?(basename)
Dir.mkdir(basename)
@joker1007
joker1007 / file0.sh
Created November 27, 2012 10:13
CentOS 6.3で、シェルスクリプト一発でchefまでインストールする ref: http://qiita.com/items/16d2827519a152b514cd
# root executes this script
# Install Libraries for build
yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison wget unzip git
# Download Ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar xvzf ruby-1.9.3-p327.tar.gz
# Create Install Directory
import Data.List
import Data.Char
import Control.Monad
import System.Environment
data Card = AMEX String | Discover String | MasterCard String | Visa String | Unknown deriving Show
detectCard :: String -> Card
detectCard cardNumber@(x:y:_)
| ("34" `isPrefixOf` cardNumber) || ("37" `isPrefixOf` cardNumber) = AMEX cardNumber
import System.Environment
import Data.List
data Shape = L | I | T | O | S | Unknown deriving Show
testData = [
[55,55,55,55],
[07,17,06,05],
[21,41,31,40],
[62,74,73,72],