Skip to content

Instantly share code, notes, and snippets.

View tdkn's full-sized avatar
😎
Power 💪

Shun Tedokon tdkn

😎
Power 💪
View GitHub Profile
@tdkn
tdkn / merge.js
Created April 11, 2018 16:08
Merge complex array of object
[
{
data: [{ x: 1, y: 2 }, { x: 3, y: 4 }]
},
{
data: [{ x: 5, y: 6 }, { x: 7, y: 8 }]
}
].map(({ data }) => data).reduce((acc, cur, i, arr) => {
acc.push(cur.map(({x, y}) => ({ [`x${i}`]: x, [`y${i}`]: y })))
return acc
@tdkn
tdkn / brew
Created October 20, 2017 03:05
my brew
brew install carthage coreutils fzf git-extras htop ranger reattach-to-user-namespace swiftlint tig tmux tree wget yarn zsh zsh-completions
brew install mongodb
brew install mysql
@tdkn
tdkn / fetch-pref.js
Last active August 23, 2017 08:57
潮位表掲載地点一覧表(2018年)
require('es6-promise').polyfill()
require('isomorphic-fetch')
const fetchAsync = async () => {
const url =
'https://rawgit.com/tdkn/87ea58d6bd9b9f0a12f6ff176a6ca76f/raw/56910dd51cb5451d33699c02b3f7ca3ae28b0749/tide-area.json'
const response = await fetch(url)
const points = await response.json()
const symbols = {}
@tdkn
tdkn / ViewController.swift
Last active November 20, 2016 13:51
Sample of SnapKit
view.addSubview(label)
label.snp.makeConstraints { (make) in
make.size.equalTo(100)
make.center.equalToSuperview()
}
@tdkn
tdkn / ViewController.swift
Created November 20, 2016 13:39
Sample of NSLayoutConstraint
label.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(label)
view.addConstraints([
NSLayoutConstraint(
item: label,
attribute: .width,
relatedBy: .equal,
toItem: nil,
attribute: .width,
multiplier: 1.0,
@tdkn
tdkn / webpack.config.js
Last active September 19, 2016 18:51
Animation製作時のWebpackのconfig
import webpack from 'webpack';
import path from 'path'
module.exports = {
entry: {
'main': `${__dirname}/_dev/js/main`,
'vendor': [
'three',
'gsap',
'pixi.js',
@tdkn
tdkn / apminstall.sh
Last active January 18, 2016 16:41
Install Atom Packages
#!/bin/sh
PACKAGES=(
minimap
minimap-autohide
minimap-git-diff
file-icons
emmet
vim-mode
@tdkn
tdkn / .vimrc
Last active April 10, 2016 16:18
bin/neoinstall 使用時の エラー(not found in 'runtimepath': "autoload/vimproc.vim")について
" https://github.com/tdkn/dotfiles/blob/master/.vimrc
"------------------------------------------------------
"---------------
" Bundler
"---------------
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
/*
* clang-exam1203.cpp
*/
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
@tdkn
tdkn / geo.html
Created August 20, 2013 03:04
Google Maps JavaScript API v3 Geocoding
<!DOCTYPE html>
<html>
<head>
<!--
(API KEYを取得して?key=YOUR_API_KEYの部分を書き換える)
API取得先: https://code.google.com/apis/console
参考文献: http://www.ajaxtower.jp/googlemaps/charset/index1.html
ドキュメント: https://developers.google.com/maps/documentation/javascript/geocoding?hl=ja
-->