Skip to content

Instantly share code, notes, and snippets.

View smagch's full-sized avatar
🗾
Hokkaido

Shimaguchi Tomoya smagch

🗾
Hokkaido
View GitHub Profile
@smagch
smagch / hook.js
Last active June 28, 2019 16:32
react hooks: resize check
import { useState, useEffect } from 'react';
import { debounce } from 'lodash';
export const useResizeState = () => {
const [ resizing, setResizing ] = useState(false);
useEffect(() => {
const handleResizeEnd = debounce(() => {
setResizing(false);
}, 300);
@smagch
smagch / slide.html
Last active March 4, 2019 09:25
Simple slider: should fix margin
<html>
<style>
html, body {
margin: 0;
}
.hidden-wrapper {
overflow: hidden;
}
.wrapper {
width: 100%;
@smagch
smagch / README.md
Last active November 12, 2018 14:37
gftable: transform json input to GitHub Flavored markdown table

gftable

Command-line which transform JSON array input to GFM Table

Usage

$ echo '{ "rows": [ { "id": 1, "name": "Tomoya" }, { "id": 2, "name": "Tomoko" } ] }' | jq .rows | gftable
@smagch
smagch / README.md
Created October 25, 2018 04:42
Algolia Example
@smagch
smagch / index.html
Created August 28, 2018 05:16
horizontal scroll testing: Intersection Observer API
<!DOCTYPE html>
<html>
<head>
<style>
.h-container {
position: absolute;
left: 0;
right: 0;
top: 100px;
height: 300px;
@smagch
smagch / responsive.sh
Last active June 28, 2018 01:49
imagemagick bash script
#!/bin/bash
SIZES=(640 1280 1920 2560 3200)
if [ $# -eq 0 ]; then
echo "画像ファイルを指定してください!"
echo "Usage1: "$0" image.jpg"
echo "Usage2: "$0" *.jpg"
exit 1
fi
<html>
<head>
<style>
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
@smagch
smagch / README.md
Created May 22, 2018 07:51
Fontcustom testing

fontcustom test

@smagch
smagch / config.js
Created May 10, 2018 02:53
Sequelize Config with config module
const path = require('path');
const defaults = require('./default.json').db;
const config = {};
const envs = [
'test',
'development'
'production'
];
@smagch
smagch / .gitignore
Last active April 18, 2018 13:31
sequalize include total number of association
/node_modules