Skip to content

Instantly share code, notes, and snippets.

View sharapeco's full-sized avatar
💭
Tengo hambre

Shinichiro Yabu sharapeco

💭
Tengo hambre
View GitHub Profile
@ksasao
ksasao / sunset.h
Last active March 26, 2025 15:25
現在地の日没時刻/日の出時刻を表示します https://x.com/ksasao/status/1898305387969012007
#ifndef SUNSET_H_
#define SUNSET_H_
#include<math.h>
// 計算式は下記のWebサイトを参考に実装しています
// 日出日没計算、やってみよう
// https://hhsprings.pinoko.jp/site-hhs/2015/02/%e6%97%a5%e5%87%ba%e6%97%a5%e6%b2%a1%e8%a8%88%e7%ae%97%e3%80%81%e3%82%84%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86/
typedef struct _DateTime {
int year;
/*!
* @author yomotsu
* Released under the MIT License.
*/
:root {
--stroke-color: #ccc;
}
* {
@youkinjoh
youkinjoh / extendJSON.md
Last active March 9, 2022 07:37
JSONが対応していない値(NaN/Infinity/Date等)をJSONに保存する方法

JSONが対応していない値をJSONに保存する方法

JSONは NaN / Infinity / -InfinityDate 型等に対応していない。 しかし、JavaScriptのJSONは、これらを解消する仕組みを持っている。 それは JSON.parse の第二引数の reviverJSON.stringify の第二引数の replacer だ。

注意が必要なのは、 Date 型は toJSON メソッドを持つため replacer に値が渡る前に文字列になってしまうこと。 これに対応するには toJSON メソッドを一時退避してしまえば良い。

これらを上手く駆使すれば、JSONに型を保ったまま値を保存し復元することができる。

@bsara
bsara / git-ssh-auth-win-setup.md
Last active April 24, 2025 05:04
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config