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
defmodule RV32Sim.Register do | |
def new do | |
<<0::32-unit(32)>> | |
end | |
def get(_, 0), do: 0 | |
def get(registers, number) do | |
<<_::size(number)-unit(32), result::32, _::bytes>> = registers | |
result |
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="ja"> | |
<head> | |
<title>COLOR CODE</title> | |
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script> | |
<style> | |
body { | |
display: flex; | |
justify-content: space-evenly; |
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
PREFIX = $(MIX_APP_PATH)/priv | |
BUILD = $(MIX_APP_PATH)/obj | |
NIF = $(PREFIX)/counter_nif.so | |
CFLAGS = -std=c++11 -fpic | |
LDFLAGS = -lpthread -dynamiclib -undefined dynamic_lookup | |
ERL_CFLAGS = -I$(ERL_EI_INCLUDE_DIR) | |
ERL_LDFLAGS = -L$(ERL_EI_LIBDIR) -lei |
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
#!/usr/bin/env ruby | |
require 'aws-sdk-ec2' | |
require 'thor' | |
class Ec2Stat < Thor | |
default_command :stat | |
desc :stat, 'show statuses of ec2 instances' | |
option :profile, aliases: '-p', default: 'default' |
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
#!/bin/sh | |
if [ "$1" = "production" ]; then | |
STAGE=production | |
elif [ "$1" = "staging" ] || [ "$1" = "" ]; then | |
STAGE=staging | |
else | |
cat <<EOS | |
usage: |
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
require 'json' | |
require 'net/https' | |
def hello(event:, context:) | |
uri = URI.parse(ENV['IDOBATA_HOOK_URL']) | |
source = event['source'] | |
Net::HTTP.post_form(uri, {source: source}) | |
end |
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
defmodule ADS7846 do | |
use Scenic.ViewPort.Driver | |
alias Scenic.ViewPort | |
require Logger | |
defguard is_pos(x, y) when is_number(x) and is_number(y) | |
@init_retry_ms 400 | |
@device "ADS7846 Touchscreen" |
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
service: emattsan | |
provider: | |
name: aws | |
runtime: ruby2.5 | |
stage: ${opt:stage, 'development'} | |
region: ap-northeast-1 | |
package: | |
exclude: |
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
# frozen_string_literal: true | |
source 'https://rubygems.org' | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem 'sinatra' | |
gem 'sinatra-contrib' | |
gem 'slim' |
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
defmodule Bits do | |
require Integer | |
import Integer | |
import Bitwise | |
@doc """ | |
A integer value to a bit list. | |
## example |
NewerOlder