Skip to content

Instantly share code, notes, and snippets.

View td-shi's full-sized avatar

TD氏 td-shi

  • Near Port
View GitHub Profile
@td-shi
td-shi / ulid.sh
Last active May 7, 2024 17:55
ULID on shell script. Universally Unique Lexicographically Sortable Identifier. [ULID](https://github.com/ulid/spec)
#!/bin/sh
# -*- coding:utf-8 posix -*-
# === Initialize shell environment =============================================
#set -u # Just stop undefined values.
#set -e # Just stop error.
#set -x # Debug running command.
umask 0022
export LC_ALL=C
export LANG=C
@td-shi
td-shi / tarot.sh
Created January 27, 2020 07:00
I bought tarot cards, also this script was made.
#!/bin/bash --posix
# -*- coding:utf-8 -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
@td-shi
td-shi / air-filtering.cfg
Created January 27, 2020 07:02
Factorio Locale Japanese [Air Filtering Advanced](https://mods.factorio.com/mod/air-filtering-patched) (MOD created by blackmaster1313)
[entity-name]
air-filter-machine-mk1=空気清浄機 癸型
air-filter-machine-mk2=空気清浄機 壬型
air-filter-machine-mk3=空気清浄機 辛型
air-filter-machine-mk4=空気清浄機 庚型
air-filter-machine-mk5=空気清浄機 己型
air-filter-machine-mk6=空気清浄機 戊型
[item-name]
unused-air-filter=エアフィルタ
@td-shi
td-shi / data-final-fix.lua
Created January 27, 2020 07:04
Factorio Block spitter attack.
--For 0.13.13 and later there will be layer-10 through layer-15 that can be used.
local projectile_layer = "layer-13"
local suffix = "-blockable"
local function make_projectile_blockable (prototype_name)
local prototype = data.raw.projectile[prototype_name]
if not prototype then
return prototype_name
end
local newname = prototype.name .. "-blockable"
@td-shi
td-shi / data.lua
Created January 27, 2020 07:06
factorio distillation-science-pack_0.2
data:extend(
{
{
type = "recipe",
name = "distillation-science-pack-2",
enabled = "true",
ingredients =
{
{"science-pack-1", 3}
},
@td-shi
td-shi / encode_7seg.vhd
Created January 27, 2020 07:08
VHDL 7SEGLED encoder.
library ieee;
use ieee.std_logic_1164.all;
entity encode_7seg is
generic(COMMON: integer range 0 to 1 := 0);
port(DIN: in integer range 0 to 127;
DOT: in std_logic;
SEG7LED: out std_logic_vector(7 downto 0));
end encode_7seg;
@td-shi
td-shi / character.md
Created January 27, 2020 07:10
self building.

キャラクター

メタ

  • 概要
  • 役割
  • 性質

身体特徴

  • 身長
  • 重量
  • 外見 :: 顔 体 髪 服飾 好む色 特徴
@td-shi
td-shi / Arty_Constraint.xdc
Created January 27, 2020 07:12
Arty Constraint
## Arty constraints file
## project: ?????
## Manual <https://reference.digilentinc.com/reference/programmable-logic/arty-a7/reference-manual>
## Pin <https://reference.digilentinc.com/_media/reference/programmable-logic/arty-a7/arty_a7_sch.pdf>
## Clock signal
set_property PACKAGE_PIN E3 [get_ports {CLK}]
set_property IOSTANDARD LVCMOS33 [get_ports {CLK}]
create_clock -add -name sys_clk_pin -period 10.00 \
-waveform {0 5} [get_ports {CLK}]
@td-shi
td-shi / apache_building.md
Last active February 29, 2020 06:05
Apache2.0 building.

versions

  • datetime :: 2019-05-21
  • Machine :: Tinker board S
  • OS :: debian 9
  • Apache2 :: 2.4.25
  • OpenSSL :: 1.1.0j
  • certbot :: 0.28.0
  • curl :: 7.52.1
  • wget :: 1.18
#!/bin/bash --posix
# -*- coding:utf-8 -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.