Skip to content

Instantly share code, notes, and snippets.

View tkfm-yamaguchi's full-sized avatar

Takafumi Yamaguchi tkfm-yamaguchi

View GitHub Profile
@tkfm-yamaguchi
tkfm-yamaguchi / plotly-react-markers-plus-text.html
Last active March 26, 2021 09:42
Plotly.react() doesn't work properly when mode is 'markers+text'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>text test</title>
</head>
<body>
<button id="btn">Toggle text</button>
<div id="app" style="width: 600px; height: 250px;"></div>
@tkfm-yamaguchi
tkfm-yamaguchi / index.html
Created July 29, 2020 01:43
IntersectionObserver memo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Intersection Observer</title>
<style>
#outer {
height: 500px;
width: calc(100vw - 100px);
@tkfm-yamaguchi
tkfm-yamaguchi / box-shadow.html
Created January 9, 2020 09:57 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@tkfm-yamaguchi
tkfm-yamaguchi / my-combination.rb
Last active December 3, 2019 14:36
RIoW for Array#combination, but it is a single method.
require "test/unit"
def combination(a, k)
return a.map{|n| [n] } if k == 1
a[0..(a.size - k)].each_with_index.reduce([]) do |c, (n, i)|
c + combination(a[i.succ..-1], k - 1).map{|r| [n, *r]}
end
end
@tkfm-yamaguchi
tkfm-yamaguchi / MyController.php
Last active November 26, 2019 09:01
the simplest form of Symfony controller
<?php
namespace AppBundle\Controller;
use Exception;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
@tkfm-yamaguchi
tkfm-yamaguchi / duplicateds.md
Last active February 18, 2019 01:00
duplicated homebrew formulae

Errors while executing brew update

fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-completions failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-fuse failed!
@tkfm-yamaguchi
tkfm-yamaguchi / needs-to-fix.md
Created February 5, 2019 04:30
needs to fix

Needs To Fix

  • vim-jsx-typescript
    • syntax/indent: would be broken when {} to execute JS/TS
    • syntax/indent: would be broken when no value attribute is specified
@tkfm-yamaguchi
tkfm-yamaguchi / open_dir_with_vaffle.vim
Last active February 5, 2019 04:07
Open dir with vaffle when dir is specified while starting vim
" Open vaffle when the first buffer is a directory
" (the directory name is specified as a argument in terminal)
function! s:open_dir_with_vaffle()
let l:bufName = bufname('%')
if (isdirectory(l:bufName))
execute "Vaffle " . l:bufName
endif
endfunction
@tkfm-yamaguchi
tkfm-yamaguchi / index.html
Last active January 23, 2019 15:47
OwlCarousel's bug when {loop: false, autoWidth: true} (reproduction & workaround)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Workaround for OwlCarousel's autoWidth:true/loop:false bug</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css">
<style>
/* common style */
.carousel-item {
@tkfm-yamaguchi
tkfm-yamaguchi / run_terms.vim
Created January 22, 2019 14:49
Create tab for terminals within js project
function! RunTerms()
-tabnew
terminal ++close ++curwin yarn start
terminal ++close yarn test
" use `term_start` to set 'cwd' option
vertical call term_start('http-server -p 8000 --cors', {'cwd': 'data', 'term_finish': 'close'})
endfunction