Skip to content

Instantly share code, notes, and snippets.

View roamer7038's full-sized avatar

R-7038/ろき roamer7038

  • Japan
View GitHub Profile
@roamer7038
roamer7038 / AspectRatio.tsx
Last active June 5, 2024 06:46
Implement AspectRatio independent of ChakraUI
import React, { forwardRef, ReactNode, CSSProperties } from 'react';
// クラス名を結合するユーティリティ関数
// 引数として複数のクラス名を受け取り,それらを空白で結合します
const cx = (...classNames: (string | undefined)[]) => classNames.filter(Boolean).join(' ');
// レスポンシブな値に対してマッピングを適用するユーティリティ関数
// 引数としてプロパティとマッパー関数を受け取り、プロパティが配列やオブジェクトの場合はそれぞれの要素にマッパー関数を適用します。
// プロパティがnullでない単一の値の場合はその値に直接マッパー関数を適用します。
const mapResponsive = (prop: number | number[] | { [key: string]: number }, mapper: (val: number) => string) => {
@roamer7038
roamer7038 / oryx-docker-compose.yml
Created May 3, 2024 03:11
Oryx (SRS Stack) Docker Compose
services:
oryx:
image: ossrs/oryx:5
container_name: oryx
restart: unless-stopped
volumes:
- ./data:/data
ports:
- "80:2022"
- "443:2443"
#!/bin/sh
set -ux
#--------------------
# before install setting
#--------------------
HOSTNAME="localhost"
ROOTPASSWD="password"
ADDRESS='192.168.1.58/24'
GATEWAY='192.168.1.1'
remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L
@roamer7038
roamer7038 / install_mineos-node
Last active July 28, 2016 19:12 — forked from hexparrot/install_mineos-node
Downloads, installs and configures components required for the MineOS Web User Interface on rpm based systems using systemd.
#!/bin/sh
# update repositories
#yum update
# download the necessary prerequisite components for mineos
curl -sL https://rpm.nodesource.com/setup_4.x | bash -
yum -y install screen git wget java-1.8.0-openjdk-headless.x86_64 openssl openssl-devel
yum -y groupinstall "Development tools"
yum -y install nodejs
@roamer7038
roamer7038 / install_Minecraft-Overviewer
Last active January 12, 2017 18:06
Minecraft-Overviewer 's config file
#!/bin/sh
# download the overviewer.repo
curl -o /etc/yum.repos.d/overviewer.repo -L http://overviewer.org/rpms/overviewer.repo
# rewrites the '$releasever' to 'latest'
sed -i 's/$releasever/latest/g' /etc/yum.repos.d/overviewer.repo
# install
yum install -y Minecraft-Overviewer
@roamer7038
roamer7038 / ProxySwitch.wsf
Created January 29, 2016 10:39
プロキシサーバのオン・オフ切り替えスクリプト
<job id="main">
<script language="JavaScript">
var objWshShell;
var proxy;
objWshShell = WScript.CreateObject("WScript.Shell");
proxy = objWshShell.RegRead("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable");
if(proxy == 0){
objWshShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable",1,"REG_DWORD");
WScript.Echo("プロキシ設定を オン にしました");