Skip to content

Instantly share code, notes, and snippets.

puts "否定論理積 NAND"
NAND = ->(x, y) { (x & y) == 0 ? 1 : 0 }
puts NAND[0, 0]
puts NAND[0, 1]
puts NAND[1, 0]
puts NAND[1, 1]
puts "否定 NOT"
NOT = ->(x) { NAND[x, x] }
puts NOT[0]
@takaheraw
takaheraw / rs_flip_flop.rb
Created April 29, 2023 01:50
RSフリップフロップ
class RSFlipFlop
def initialize
@q = 0
@q_not = 1
end
def set
@q = 1
@q_not = 0
end
@takaheraw
takaheraw / masotodon_development.md
Last active December 31, 2020 00:51
Mastodon development
@takaheraw
takaheraw / index.html
Created October 6, 2018 23:50
vue router
<!DOCTYPE html>
<html>
<head>
<title>Vue.js SPAのサンプルアプリケーション</title>
<style>
[v-cloak] {
display: none
}
</style>
</head>
@takaheraw
takaheraw / login.html
Created September 30, 2018 01:22
vue component
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<div id="login-example">
<user-login></user-login>
</div>
<script type="text/x-template" id="login-template">
<div id="login-template">
<div>
<input type="text" placeholder="ログインID" v-model="userid">
@takaheraw
takaheraw / index.html
Created September 30, 2018 00:58
vue component
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<div id="fruits-counter">
<div v-for="fruit in fruits">
{{ fruit.name }}: <counter-button v-on:increment="incrementCartStatus()"></counter-button>
</div>
<p>合計: {{ total }}</p>
</div>
<script>
@takaheraw
takaheraw / app.js
Created September 29, 2018 23:07
vue.jsの基本
var items = [
{
name: '鉛筆',
price: 300,
quantity: 0
},
{
name: 'ノート',
price: 400,
quantity: 0
@takaheraw
takaheraw / server.conf
Created July 17, 2018 08:22
server.conf
<source>
@id input_forward
@type forward
port 24224
</source>
<match club.access>
@type copy
<store>
@type s3
@takaheraw
takaheraw / agent.conf
Created July 17, 2018 08:18
agent.conf
<system>
process_name fluentd
</system>
<source>
@id input_forward
@type forward
port 24224
</source>
@takaheraw
takaheraw / fluentd_install.md
Created July 17, 2018 08:16
fluentd_install.md

install

  • Amazon Linux1
$ curl -L https://toolbelt.treasuredata.com/sh/install-amazon1-td-agent3.sh | sh
  • 自動起動