- Google製
- 一部ECMAになってる(古い時代の仕様)
- 型あり(基本静的型付けだけど、動的型付けも可能。型推論もある)
- 最新Version: 2.17.0
- インタプリタ(CLI等)とコンパイラ(スマホ用ビルド等)がある
- 元々はWeb用のスクリプト言語用途で開発、JSにコンパイル可能(2011年~)
- Flutterに採用されてブレイク
- 【翻訳記事】なぜFlutterにおいてDartを使用するのか? - Qiita https://qiita.com/yasutaka_ono/items/608405a27e57cc30e0d7
- 静的言語と動的言語のいいところどり
- 【翻訳記事】なぜFlutterにおいてDartを使用するのか? - Qiita https://qiita.com/yasutaka_ono/items/608405a27e57cc30e0d7
This file contains hidden or 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
def toribonatti(number) | |
i1 = 0 | |
i2 = 0 | |
i3 = 1 | |
result = [] | |
result << i1 | |
result << i2 | |
result << i3 |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/lambda" | |
) |
This file contains hidden or 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
#add_newline = false | |
format = """ | |
[┌───────────────────](bold green) | |
[│](bold green)$directory$username$aws$git_branch | |
[│](bold green) """ | |
[git_branch] | |
format = "[$symbol$branch]($style) " |
This file contains hidden or 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
require "ipaddr" | |
class RouteTable | |
def initialize(routes) | |
@routes = routes | |
end | |
# IPAddr or nil | |
# nil -> direct connected | |
def next_hop_route_entry(dst_addr) |
This file contains hidden or 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
Router(config)# show config | |
Using 1114 out of 524288 bytes | |
! NEC Portable Internetwork Core Operating System Software | |
! IX Series IX2010 (magellan-sec) Software, Version 7.3.27, RELEASE SOFTWARE | |
! Compiled Apr 27-Thu-2006 14:03:32 JST #2 | |
! Last updated Jun 22-Tue-2021 23:48:46 JST | |
! | |
! | |
timezone +09 00 |
This file contains hidden or 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
require "socket" | |
require "rb_tuntap" | |
PEER = "" | |
PORT = 9876 | |
tun = RbTunTap::TunDevice.new("tun0") | |
tun.open(false) | |
tun.addr = "192.168.0.1" | |
tun.netmask = "255.255.255.0" |
This file contains hidden or 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 Kure1 | |
def self.run | |
"kure" | |
end | |
end | |
# puts Kure1.run | |
class Kure2 | |
def initialize(param) |
This file contains hidden or 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
require "socket" | |
SIOCGIFFLAGS = 0x8913 | |
sock = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0) | |
ifreq = ["eth0"].pack("a4") | |
sock.ioctl(SIOCGIFFLAGS, ifreq) | |
result = ifreq[Socket::IFNAMSIZ, 0x02].dup |
This file contains hidden or 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
require "aws-sdk" | |
RSpec.describe "Test" do | |
it "test" do | |
allow(Aws::EC2::Resource).to receive(:new).and_return("Aws1") # ① | |
allow(Aws::EC2::Resource).to receive(:new).with(region: "ap-northeast-1").and_return("Aws2") # ② | |
allow(Aws::EC2::Resource).to receive(:new).with(hash_including(region: "ap-northeast-2")).and_return("Aws3") # ③ | |
ec2 = Aws::EC2::Resource.new | |
pp ec2 # => "Aws1", 引数が無いので①に該当 |
NewerOlder