Skip to content

Instantly share code, notes, and snippets.

@slnq
slnq / monisim.html
Last active August 16, 2025 06:58
monitor simulator
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>モニター配置シミュレーター</title>
<style>
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans JP", sans-serif; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
label { white-space: nowrap; }
input[type="number"] { width: 5rem; }
@slnq
slnq / dup.gs
Last active July 8, 2025 10:54
A bot that tweets based on YouTube's RSS and API
function checkDuplicatesInColumnA() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const values = sheet.getRange("A1:A" + sheet.getLastRow()).getValues().flat();
const seen = new Set();
const duplicates = [];
for (const value of values) {
if (seen.has(value)) {
duplicates.push(value);
@slnq
slnq / draw_boundaries.py
Created April 11, 2025 15:07
made by GPT-4o
import os
from PIL import Image
# 定義カラー(RGB)
COLOR_454351 = (0x45, 0x43, 0x51) # #454351
COLOR_DCDCE0 = (0xdc, 0xdc, 0xe0) # #dcdce0
TRANSPARENT = (0, 0, 0, 0) # 完全透過
# 入力・出力ディレクトリの指定
input_dir = './lagtrain/2'
@slnq
slnq / fibonacci_graph.tex
Created November 1, 2024 11:31
lualatex scripting
\documentclass{ltjsarticle}
\usepackage[top = 10truemm, bottom = 20truemm, left = 15truemm, right = 15truemm]{geometry}
\usepackage{luacode}
\usepackage{tikz, pgfplots}
\pgfplotsset{compat = 1.16}
\begin{luacode*}
!rm -rf ./all
!mkdir -p all
# Gnuplot スクリプト
# 出力形式の設定
set terminal pngcairo size 1600,1200 enhanced font 'Verdana,20'
set output 'all/frame_%04d.png'
# グラフの範囲設定
@slnq
slnq / hiteigaki.c
Last active February 5, 2024 07:17
否定書きに関するプログラム
#define N 1260L
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
double yokogaki(double y, double x) {
return (x-1)*y + sqrt(pow(x-1, 2)+1.0)*(y-1);
}
@slnq
slnq / easing.html
Last active October 30, 2023 15:22
手描きでイージングを描き動かす: https://gist-4d0c6.web.app/draw.html
<html>
<body>
<canvas id='canvas'></canvas>
<div id="square"></div>
<style>
html,body {
overflow: hidden;
@slnq
slnq / se
Last active February 7, 2024 08:52
set terminal pdfcairo color enhanced font "Arial,12"
set samples 1000
set ylabel 'Intensity'
set xlabel 'energy transfer / meV'
#set style fill transparent solid 0.50 noborder
set style fill solid 0.50 noborder
set key vertical maxrows 2 right top
set noautoscale xy
set noytics
@slnq
slnq / userChrome.css
Last active October 26, 2024 14:08
setting for Firefox and Vivaldi
#forward-button, #back-button, #context-sendpagetodevice, #context-inspect-a11y, #context-savepage, #context-selectall, #context-viewsource, #context-inspect, #context-screenshot, #context-openlinkintab, #context-openlink, #context-openlinkprivate, #context-bookmarklink, #context-sendlinktodevice, #context-viewpartialsource-selection, #context-sendimage, #context-setDesktopBackground, #unified-extensions-button, #star-button, #PanelUI-menu-button, menuseparator { display: none !important; }
:root {
--tab-min-height: 25px !important;
--urlbar-min-height: 20px !important;
}
.browserContainer > findbar {
position: fixed;
top: 1;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<form>
<table>
<tr>
<td align="right"><label for="input_targets">targets :</label></td>