Skip to content

Instantly share code, notes, and snippets.

@mazeltov7
mazeltov7 / gist:5520014
Last active December 17, 2015 00:19
カレーのレシピ(テスト)
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="description" content="カレーのレシピ">
<title>カレーのレシピ</title>
<link rel="shortcut icon" href="https://lh6.googleusercontent.com/-v9uEQkrr6Ic/AAAAAAAAAAI/AAAAAAAAAxE/x0HilNQSXJM/s120-c/photo.jpg">
</head>
<body>
<header>
@mazeltov7
mazeltov7 / gist:5669380
Last active December 17, 2015 20:39
test
puts 'よう来たのう'
command = gets.chomp
while command != command.upcase
puts 'なんじゃて、もっと大きな声で叫んでくれ'
command = gets.chomp
end
puts '元気かいなー?'
command2 = gets.chomp
@mazeltov7
mazeltov7 / 閏年
Created May 30, 2013 06:02
閏年(ruby)
puts '先頭の年'
start = gets.chomp.to_i
puts '末尾の年'
stop = gets.chomp.to_i
puts 'うるう年一覧'
year = start
while year <= stop
if (year % 400 == 0) ||
(year % 100 != 0 && year % 4 == 0)
@mazeltov7
mazeltov7 / テストサイト1
Created June 1, 2013 05:58
テストサイト1
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>CSS課題</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrap">
<header id="header">
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@mazeltov7
mazeltov7 / gist:c4e359871375884f2f92
Created April 19, 2015 06:59
PDOで複数データをまとめてinsertしたい
// 遅い、つらい
$sql = "insert into hoge_table (name, screen_name) values (:name, :screen_name)";
$stmt = $dbh->prepare($sql);
for($i=0;count($contents->statuses);$i++){
$params = array(
":name" => $contents->statuses[$i]->name,
":screen_name" => $contents->statuses[$i]->screen_name
)
$stmt->execute($params);
}