Skip to content

Instantly share code, notes, and snippets.

View yushimatenjin's full-sized avatar

yushimatenjin

View GitHub Profile
@yushimatenjin
yushimatenjin / CategorySagas.js
Created January 6, 2019 11:23 — forked from pesakitan22/CategorySagas.js
Redux-Saga for next.js
import {call, put, take, fork} from 'redux-saga/effects'
import {END} from 'redux-saga'
import CategoryActions, {CategoryTypes} from '../Redux/CategoryRedux'
// attempts to fetch category
export function* fetchCategoryServer (api) {
let action = yield take(CategoryTypes.CATEGORY_SERVER)
// check when it stopped
while (action !== END) {
yield fork(fetchCategoryAPI, api)
@yushimatenjin
yushimatenjin / index.md
Created January 9, 2019 15:06 — forked from mitsuruog/index.md
express実践入門

express実践入門


自己紹介

小川充

  • mitsuruog
@yushimatenjin
yushimatenjin / init.js
Created June 10, 2019 03:03
firebase-tools/src/commands/init.js
# firebase-tools/src/commands/init.js
idx = 0
VRMs[idx].vrm.humanoid.humanBones.forEach(({bone, node}) => {
console.log(`${bone}: ${VRMs[idx].nodes[node].name}`)
})
var FirstPersonCamera = pc.createScript('firstPersonCamera');
// initialize code called once per entity
FirstPersonCamera.prototype.initialize = function() {
// Camera euler angle rotation around x and y axes
this.ex = 0;
this.ey = 0;
// Disabling the context menu stops the browser displaying a menu when
// you right-click the page
var Replace2CanvasFont = pc.createScript('replace2canvasFont');
// initialize code called once per entity
Replace2CanvasFont.prototype.initialize = function() {
this.app.root.findComponents('element').forEach(function(elm){
if(elm.type === 'text') {
var font = new pc.CanvasFont(pc.app, {
fontName: 'UD Digi Kyokasho N-R, Helvetica, arial, sans-serif',
fontSize: 128,
});
var Replace2CanvasFont = pc.createScript('replace2canvasFont');
// initialize code called once per entity
Replace2CanvasFont.prototype.initialize = function() {
this.app.root.findComponents('element').forEach(function(elm){
if(elm.type === 'text') {
var font = new pc.CanvasFont(pc.app, {
fontName: 'UD Digi Kyokasho N-R, Helvetica, arial, sans-serif',
fontSize: 128,
});
/*jshint esversion: 6, asi: true */
const EmojiRandom = pc.createScript('emojiRandom');
// initialize code called once per entity
EmojiRandom.prototype.initialize = function() {
setInterval(() => {
const emojiCode = Math.floor(Math.random() * (129685 - 129660 + 1) + 129660);
const emoji = String.fromCodePoint(emojiCode)
console.log(emoji)
this.app.fire("text:set", this.entity.element, emoji)
@yushimatenjin
yushimatenjin / input.scss
Created April 27, 2022 01:45
Generated by SassMeister.com.
.chat{
width: 300px;
padding: 0.5rem;
border-radius: 0.5rem;
border: 1px solid;
background: white;
}
.header{