Skip to content

Instantly share code, notes, and snippets.

Avatar

Shun Takahashi shuntksh

View GitHub Profile
View hackerrank_input_parser.go
package main
import (
"fmt"
"strings"
"bufio"
"bytes"
"strconv"
"io"
"os"
)
@shuntksh
shuntksh / file0.js
Last active Mar 31, 2017
WebpackってCSS周りのLoaderがいっぱいあって分かりにくいので整理してみる ref: http://qiita.com/shuntksh/items/bb5cbea40a343e2e791a
View file0.js
{
test: /\.css$/,
loader: "style-loader!css-loader?modules&importLoaders=1&camelCase!postcss-loader",
},
@shuntksh
shuntksh / file0.js
Last active Feb 2, 2017
React.jsのrenderの戻り値の中で.bindで新しい関数を定義してはいけないわけ ref: http://qiita.com/shuntksh/items/fd81ca9aa31ea8f962e2
View file0.js
// 悪い例:render関数内で新しい関数を定義
class MyComponent extends React.Component {
render() {
const { value, handleChange } = this.props;
return <input value={value} onChange={handleChange.bind(this)} />
}
}
@shuntksh
shuntksh / seq_promise.js
Created Dec 19, 2016
Promise Sequential Iteration
View seq_promise.js
const urls = ['/task1', '/task2', ];
let promise = Promise.resolve();
tasks.forEach((task) => {
promise = promise.then(() => request.get(task));
});
@shuntksh
shuntksh / mov2gif.sh
Created Jun 30, 2016
Generate Animated GIF from Mov file on Mac with ffmpeg / imagemagick
View mov2gif.sh
brew install imagimagick ffmpeg
ffmpeg -i <INPUT_FILE>.mov -r 10 -f image2pipe -vcodec ppm - | convert -delay 30 -layers Optimize -loop 0 - <OUTPUT_FILE>.gif
You can’t perform that action at this time.