Skip to content

Instantly share code, notes, and snippets.

View og24715's full-sized avatar
๐Ÿ˜‘
Reconstructing the fragments of chaos.

HIRAKAWA og24715

๐Ÿ˜‘
Reconstructing the fragments of chaos.
  • Shizuoka, Japan
View GitHub Profile
@og24715
og24715 / Application.jsx
Last active May 9, 2019 01:30
React Navigation with Redux Boilerplate Code
import React from 'react';
import { Provider, connect } from 'react-redux';
import { reduxifyNavigator } from 'react-navigation-redux-helpers';
import pageNation from './pageNation';
import { configureStore } from './Store';
const store = configureStore();
const mapStateToProps = (state) => ({
state: state.nav,
@og24715
og24715 / .md
Created July 24, 2018 05:59
Twitter ใงๆ–ฐใ—ใใƒ„ใ‚คใƒผใƒˆใ‚’ๅ–ๅพ—ใ™ใ‚‹ๆ™‚ใซ้‡่ค‡ใชใ—ใซใŒใฃใกใ‚ƒใ‚“ใ“ใ™ใ‚‹
const newList = [1, 2, 3, 4, 5]
const list = [4, 5, 6, 7, 8]
const endIndex = newList.findIndex(item => item === list[0]) // -> 3

const diff = newList.slice(0, endIndex === -1 ? undefined : endIndex)

console.log([...diff, ...list]) // -> [1, 2, 3, 4, 5, 6, 7, 8]
@og24715
og24715 / rapidWiggle.ahk
Last active July 23, 2018 15:23
Rapid wiggle for Dead by Daylight powered by AHK
~$f10::
While GetKeyState("f10", "P"){
Send {a}
Send {d}
Sleep 0.01 ;milliseconds
}
return
f12::
@og24715
og24715 / my.deflist.item.json
Created June 27, 2018 04:42
niconico mylist item json
{
"item_type":"0",
"item_id":"1461952399",
"description":"",
"item_data":{
"video_id":"sm28739739",
"title":"ใ€็ฌฌ16ๅ›žMMDๆฏExใ€‘ใƒใƒˆใƒซใƒปใ‚ชใƒ–ใƒป็ด…้ญ”้คจโ…กๅ‰็ทจ",
"thumbnail_url":"http://tn.smilevideo.jp/smile?i=28739739",
"first_retrieve":1461953251,
"update_time":1521939540,
@og24715
og24715 / .md
Last active December 25, 2018 05:39
React + Webpack (+ Chrome Extension) ๆœ€ๅฐๆง‹ๆˆ

og24715/ABRepeatForYouTube ใ‚’ไฝœใ‚‹ใซๅฝ“ใŸใ‚Š create-react-app ใ‚’ไฝฟใ‚ใšใซ React ใ‚ขใƒ—ใƒชไฝœใ‚‹ใฎใฉใ†ใ‚„ใฃใŸใฃใ‘ใ€ใชใฃใŸใฎใง Webpack ใ‚’ไฝฟใฃใŸๆœ€ๅฐๆง‹ๆˆใ‚’ใกใพใกใพๆ›ธใใ€‚

$ yarn add react react-dom
$ yarn add -D babel @babel/core @babel/preset-env @babel/preset-react @babel/preset-stage-0 babel-loader webpack webpack-command
const path = require('path');
@og24715
og24715 / setting-up-babel-nodemon.md
Last active April 16, 2018 00:53 — forked from sam-artuso/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
yarn init -y
@og24715
og24715 / binary.md
Last active June 13, 2018 01:48
ใƒใ‚คใƒŠใƒช่ทไบบ

hex string -> buffer

const hexString = '00AA55FF';
const buffer = Buffer.from(hexString, 'hex'); // <Buffer 00 aa 55 ff>

const firstByte = buffer.slice(1, 3) // <Buffer aa 55>

buffer -> hex string

React Native ใŠใผใˆใŒใ

Could not find com.android.tools.build:gradle:3.0.1.

buildToolsVersion ใ‚’ 26.x.x ใธใƒใƒผใ‚ธใƒงใƒณใ‚ขใƒƒใƒ—ใ—ใŸใ‚‰ๅ‡บใŸใ€‚

* What went wrong:
A problem occurred configuring root project 'ypkit'.
> Could not resolve all files for configuration ':classpath'.
@og24715
og24715 / chromeExtensionByUsingReact.md
Last active February 27, 2018 07:50
chromeExtension ใฎใƒใƒƒใƒ—ใ‚ขใƒƒใƒ—ใ‚’ React ใงไฝœใ‚‹

chromeExtension ใฎใƒใƒƒใƒ—ใ‚ขใƒƒใƒ—ใ‚’ React ใงไฝœใ‚‹

ใ“ใ‚Œ่ฆ‹ใชใŒใ‚‰ใ‚„ใฃใฆใฟใ‚‹

How to build a Chrome Extension with React JS โ€“ Code == Life

ๅ•้กŒ

popup/index.html ใฎใ‚ˆใ†ใซ้šŽๅฑคใ‚’ๆŽ˜ใ‚‹ใจ ๆญฃใ—ใ่กจ็คบใ•ใ‚Œใชใ„

@og24715
og24715 / cloneWithNewProps.jsx
Created February 23, 2018 02:25
How to clone React element with new props.
render() {
return (
{React.Children.map(
this.props.children,
(child, index) => {
switch (typeof child) {
case 'string':
return child
case 'object':