Skip to content

Instantly share code, notes, and snippets.

View abekoh's full-sized avatar

Kotaro Abe abekoh

View GitHub Profile
@Hebilicious
Hebilicious / cloudflare-pages-bun.env
Last active June 2, 2024 20:48
Cloudflare Pages and Bun
# Bun is now officially supported and these environments variables are no longer needed. Keeping this gist for legacy purposes.
# SKIP_DEPENDENCY_INSTALL=true
# UNSTABLE_PRE_BUILD=asdf install bun latest && asdf global bun latest && bun i
@giuliano-macedo
giuliano-macedo / download_file.rs
Last active January 25, 2024 08:52
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};
@Zekfad
Zekfad / conventional-commits.md
Last active June 12, 2024 07:42
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@azu
azu / 0.md
Last active April 29, 2020 15:26
Oculus GoのブラウザでDアニメを再生する方法

Oculus Goの標準ブラウザでDアニメを見る手順

1. dアニメストアへログイン

dアニメストアをブラウザで開きログインする

2. ブラウザ右上の"デスクトップをリクエスト"をONにしてPC表示

モバイル表示だと"視聴する"ボタンを押したときにポップアップが開けずに再生画面へたどり着けないため、あらかじめPC表示にする。 サイトとプレイヤーでそれぞれPC表示にする必要があることに注意

[JavaScript] オブジェクト, Map, WeakMap の使い分け方

概要

JavaScript で下記4点を連想配列として用いる場合の使い分け方を解説します。

  • オブジェクト初期化子
  • Object.create(null)
  • Map
  • WeakMap
@yuta0801
yuta0801 / GetYouTubeLiveChat.md
Last active May 31, 2023 15:47
YouTubeLiveChatを取得する

YouTubeライブチャットを取得する

注意:ライブラリなどを使用すれば更にかんたんに安定に取得できる可能性がありますが、

ここではライブラリを使わずにAPIKEYだけで使えるAPIのみで取得することを優先しています

1, ライブIDを取得する

この工程は省略できますが、毎回IDを教えて上げる必要があります。

@wuct
wuct / config-overrides.js
Last active October 5, 2022 17:17
This is a react-app-rewired config which allows you to import PureScript code in a create-react-app project directly.
module.exports = function override(config, env) {
config.module.rules = config.module.rules.map(rule => {
if (rule.oneOf instanceof Array) {
return {
...rule,
// create-react-app let every file which doesn't match to any filename test falls back to file-loader,
// so we need to add purs-loader before that fallback.
// see: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/config/webpack.config.dev.js#L220-L236
oneOf: [
{
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active June 11, 2024 22:14
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@phizaz
phizaz / async.py
Last active April 3, 2024 15:44
Python turn sync functions to async (and async to sync)
import functools
def force_async(fn):
'''
turns a sync function to async function using threads
'''
from concurrent.futures import ThreadPoolExecutor
import asyncio
pool = ThreadPoolExecutor()
@bfredl
bfredl / nvim-terminal-edit.py
Last active March 1, 2024 01:02 — forked from tarruda/nvim-terminal-edit.py
Edit file in host Neovim instance from a :terminal buffer
#!/usr/bin/env python
"""Edit a file in the host nvim instance."""
from __future__ import print_function
import os
import sys
from neovim import attach
args = sys.argv[1:]
if not args: