Skip to content

Instantly share code, notes, and snippets.

@syuji-higa
syuji-higa / Raymarching.shader
Last active November 16, 2019 03:58
Unity - Shader Raymarching
Shader "Unlit/Raymarching"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "Queue" = "Transparent" "RenderType" = "Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
@syuji-higa
syuji-higa / Child.vue
Last active November 16, 2019 03:58
Vue.js - child component status
<template>
<input type="text" :value="name" @input="onInput" />
</template>
<script>
export default {
props: {
name: {
type: String,
required: true
@syuji-higa
syuji-higa / index.js
Last active November 16, 2019 04:26
JavaScript - @loaders.gl load glTF
import { load } from '@loaders.gl/core'
import { GLTFLoader, postProcessGLTF } from '@loaders.gl/gltf'
;(async () => {
const gltfData = await load('model.gltf', GLTFLoader, {
uri: '/',
gltf: {
parserVersion: 2
}
})
@syuji-higa
syuji-higa / Child.vue
Last active November 16, 2019 04:01
Vue.js - data flow
<template>
<Grandchild
:name="name"
@input="updateData('name', $event)"
/>
</template>
<script>
import Grandchild from '~/components/Grandchild'
export default {
@syuji-higa
syuji-higa / index.js
Last active November 16, 2019 04:26
JavaScript - create CSV
const $link = document.createElement('a')
const csvName = 'index.csv'
let csv = ''
for(let i = 0; 10000 > i; i++) {
csv += 'a,b,c,d,e\n'
}
const blob = new Blob([csv], { type: 'text/csv' })
@syuji-higa
syuji-higa / .stylelintrc.js
Last active November 16, 2019 04:04
Style Lint - default setting
module.exports = {
'extends': 'stylelint-config-standard',
rules: {
'no-descending-specificity': null,
'no-duplicate-selectors': null,
'at-rule-no-unknown': null
}
}
@syuji-higa
syuji-higa / node-run.yml
Last active November 16, 2019 04:04
GitHub Actions - run Node.js
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
@syuji-higa
syuji-higa / nuxt.config.js
Last active November 16, 2019 04:05
Nuxt.js - private IP API server
import internalIp from 'internal-ip'
export default async () => {
let apiBaseUrl = 'http://localhost:8000/api/v1'
if (process.env.NODE_ENV === 'develop') {
const ip = await internalIp.v4()
apiBaseUrl.replace(/localhost|127\.0\.0\.1|0\.0\.0\.0/, ip)
}
@syuji-higa
syuji-higa / .env.develop
Last active December 26, 2021 06:32
Nuxt.js - env module for axios
API_BASE_URL=http://localhost:8000
@syuji-higa
syuji-higa / gtm.js
Last active November 16, 2019 04:06
Nuxt.js - GTM
export const pushGtmEvent = (event = 'nuxt.historyChange) => {
if(window.dataLayer) {
setTimeout(() => {
window.dataLayer.push({ event })
}, 500)
}
}