Skip to content

Instantly share code, notes, and snippets.

View omas's full-sized avatar

Omas Naohiko omas

  • Private
  • Okinawa, Japan
View GitHub Profile
function answer1(){
// 変数を使ったパターン ちょっとインチキ
var myArray = ["c", "o", "d", "e", "s", "t", "u", "d", "y"];
var start = 1;
var end = 4;
for(var count = start; count < end; count++) {
output(myArray[count]);
}
}
function Aisatsu(){
output("おはよう");
output("こんにちは");
output("こんばんは");
}
Aisatsu();
// 宿題 06/16:0900
a {
color: #017acd;
}
/* コンテナ */
div#container {
width: 760px;
margin-left: auto;
margin-right: auto;
}
@omas
omas / strip.sh
Last active August 29, 2015 14:02
html の タグを除去
#!/bin/bash
cat $1 \
| sed -e "s/\r//g" \
| tr "\n" "@" \
| sed -e "s/<script>[^<]*<\/script>//g" \
| sed -e "s/<style>[^<]*<\/style>//g" \
| sed -e "s/<!--[^<]*-->//g" \
| sed -e "s/&nbsp;//g" \
| sed -e "s/&gt;/>/g" \
/*
<program>
<summary>ケンシロウバージョン</summary>
<version>1.0</version>
<date>2014/06/19</date>
<author>omas</author>
<file>fizzbuzz.js</file>
<usage>jeek用</usage>
</program>
*/
ul>li {
list-style-type: none;
}
ul>li:nth-child(3n):after {
content: "Fizz";
}
ul>li:nth-child(5n):after {
content: "Buzz";
}
function Aisatsu(){
var messages =[
"おはよう"
,"こんにちは"
,"こんばんは"
];
for (var index in messages) {
output(messages[index]);
}
function Calc1(){
output(add(3,2));
output(sub(5,8));
output(mul(3,4));
output(div(7,3));
}
function add(num1,num2){
return [
"加算の結果は"
@omas
omas / chap03.js
Last active August 29, 2015 14:03
function HowOldAreYou(){
var messages = [
"あなたの名前を入力してください。"
,"あなたの年齢を入力してください。"
];
var name = prompt(messages[0]);
output(name + "さんこんにちは。");
var age = Number(prompt(messages[1]));
output("いま " + age + " 歳とすると、10年後は " + (age + 10) + " 歳ですね。");