A Pen by lynnbright on CodePen.
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 FruitController < ApplicationController | |
before_action :find_super_market, only: [:index, :show] | |
before_action :setup_discount, only: [:index, :show] | |
def index | |
#... | |
end | |
def show | |
#... |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div class="container"></div> |
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
body{ | |
background-color: #8E354A; | |
} | |
/* title area */ | |
.title h1{ | |
font-weight: 900; | |
} | |
.title h1, .title p{ | |
text-align: center; |
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
//基本題 | |
let Rna = { | |
transcript: function (gene){ | |
let gene_split = gene.split(''); | |
let res = gene_split.map(function(g){ | |
if (g === 'G'){ return 'C'} | |
else if (g === 'C'){ return 'G'} | |
else if (g === 'A'){ return 'U'} | |
else {return 'A'} | |
}).join(''); |
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
//同品項買一送一 | |
let riceBall = [ | |
{ | |
name: "tuna", | |
type: "riceball", | |
price: 20, | |
quantity: 4 | |
}, | |
{ |
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
let hotel = { | |
contact: { | |
name: "happy hotel", | |
address: "XXXXXXXXX", | |
tel: 1336783423, | |
stars: 5, //暫定 | |
site: "www.happy.com.tw" | |
}, | |
room: { |
A Pen by lynnbright on CodePen.