Skip to content

Instantly share code, notes, and snippets.

View shinshin86's full-sized avatar
👶

Yuki Shindo shinshin86

👶
View GitHub Profile
/*
* Sample code of Node.js
* Make mp3 file hash(MD5)
* (Of Course when not file type of mp3 also ok!)
*/
const crypto = require('crypto');
const md5hex = async filepath => {
const md5hash = crypto.createHash('md5');
md5hash.update(filepath, 'binary');
""""""""""""""""""""""""""""""
" プラグインセットアップ
" (Qiitaの記事内で記述した.vimrc)
"
" URL:
" https://qiita.com/shinshin86/items/eb41e4fb513bb4d3e3cd
"
" インストール(curl使用):
" curl --output ~/.vimrc https://gist.githubusercontent.com/shinshin86/b1437d59c9228852354da0c5a8fdac64/raw/5e735502dd7b986be699c5ca29dbc8119b179420/qiita-2018-12-14.vimrc
""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""
" vimrc-202005
" (require: vim-plug, fzf)
" see: https://gist.github.com/shinshin86/17fe2e40529f6244f17d32ed2e0aeec3
"
" Install(Using curl):
" curl --output ~/.vimrc {this gist raw url}
""""""""""""""""""""""""""""""
call plug#begin('~/.vim/plugged')
@shinshin86
shinshin86 / default-settings-for-my-prettier.txt
Created June 6, 2020 12:16
Default settings for my prettier
##################
# Default settings for my prettier
##################
# Install prettier
```sh
yarn add --dev prettier
```
# Add npm command
" -------------------
" Basic settings
" -------------------
" The indentation of the new line, the same as the current line.
set autoindent
" To specify a directory of backup files.
set backupdir=$HOME/vimbackup
" To work the clipboard and Windows
@shinshin86
shinshin86 / mysql-sakila-database-on-docker-setup.sh
Created August 3, 2020 14:58
MySQL Sakila Sample Database on Docker(Referring to the Repository of "budougumi0617/mysql-sakila")
#!/bin/sh
# Sakila Sample Database: https://dev.mysql.com/doc/sakila/en/
# Use Repository: https://github.com/budougumi0617/mysql-sakila
git clone https://github.com/budougumi0617/mysql-sakila.git
# Use version of 5.7
cd mysql-sakila/5.7
@shinshin86
shinshin86 / svg-to-png.sh
Created August 17, 2020 21:23
svg to png (Only available on macOS)
# svg to png (Only available on macOS)
qlmanage -t -o ./ {target svg filename}
@shinshin86
shinshin86 / check-macos-under-home-filesize.sh
Created August 30, 2020 22:12
Check the file size in under HOME dir at macOS.
sudo du -g -x -d 5 ~/ | awk '$1 >= 5{print}'
@shinshin86
shinshin86 / nextjs-google-analytics-setup-example-with-typescript.tsx
Last active December 4, 2022 00:05
Google analytics setup example at Next.js with TypeScript
// pages/_document.tsx
// And setup to next.config.js ↓↓↓
/*
module.exports = {
publicRuntimeConfig: {
TRACKING_ID: process.env.TRACKING_ID || '',
},
serverRuntimeConfig: {
TRACKING_ID: process.env.TRACKING_ID || '',
},
@shinshin86
shinshin86 / look-back-at-the-GitHub-repository-I-created.sh
Created October 30, 2020 23:46
[Shell scripts for my own use] A command to run to look back at the GitHub repository I created.
curl https://api.github.com/users/shinshin86/repos?sort=created | jq -r '.[] | { full_name: .full_name, created_at: .created_at, url: .html_url}'