Skip to content

Instantly share code, notes, and snippets.

View 9sako6's full-sized avatar
🌸
…(。>﹏<。)

Yutaro Taira 9sako6

🌸
…(。>﹏<。)
View GitHub Profile
@9sako6
9sako6 / generate_video_preview.sh
Last active March 30, 2021 14:41
generate_video_preview.sh
#!/bin/bash
set -u
source_file_name=${1}
output_file_name="preview_$(date "+%Y%d%m%H%M%S").mp4"
preview_tmp_dir=preview_tmp
split_number=${2}
numberings=$(seq 0 `expr ${split_number} \- 1`)
video_duration_ms=$(printf '%.0f\n' $(ffprobe -show_streams -print_format json ${source_file_name} 2>/dev/null | awk -F\" '/"duration"/{print $4}' | head -n 1))
@9sako6
9sako6 / [title](url) を自動でクリップボードにコピーするブックマークレット.js
Last active May 29, 2020 06:30
[title](url) を自動でクリップボードにコピーするブックマークレット
javascript:var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};function execCopy(a){var b=document.createElement("div"),c=document.createElement("pre");c.style.webkitUserSelect="auto";c.style.userSelect="auto";b.appendChild(c).textContent=a;a=b.style;a.position="fixed";a.right="200%";document.body.appendChild(b);document.getSelection().selectAllChildren(b);a=document.execCommand("copy");document.body.removeChild(b);return a}function showToast(a){var b=document.createElement("style");b.innerText="\n /* The snackbar - position it at the top and in the middle of the screen */\n #snackbar {\n visibility: hidden; /* Hidden by default. Visible on click */\n min-width: 250px; /* Set a default minimum width */\n margin-left: -125px; /* Divide value of min-width by 2 */\n background-color: #333; /* Black background color */\n color: #fff; /* White text color */\n text-align: c
declare module 'react-useanimations' {
import React from 'react';
export interface UseAnimationsProps {
style?: object;
animationKey: string;
size: number;
}
export default class UseAnimations extends React.Component<UseAnimationsProps> {}
}
@9sako6
9sako6 / easy_web_api_on_heroku.md
Last active July 8, 2023 00:47
Herokuで簡単なWeb APIを作る

Herokuで簡単なWeb APIを作る

まずは以下の単純なWeb APIを作ります。

$ curl https://enigmatic-garden-50659.herokuapp.com/
Hello World!
@9sako6
9sako6 / vscode_cpp_format_config.md
Last active February 18, 2024 05:39
VSCode C++整形時の行頭カッコやめたい

VSCode C++整形時の行頭カッコやめたい

VSCodeにC++拡張を入れていると、 Ctrl+Alt+Fでコードを整形できる。(環境によってキーバインドは違うかもしれない)

デフォルトでは{の前に改行が入り、このように整形される。

void f()
{
 // your code