Skip to content

Instantly share code, notes, and snippets.

View socheatsok78's full-sized avatar
πŸ––
ΰΌΌ ぀ β—•_β—• ༽぀ is having a baby

Socheat Sok socheatsok78

πŸ––
ΰΌΌ ぀ β—•_β—• ༽぀ is having a baby
View GitHub Profile
@socheatsok78
socheatsok78 / README.md
Last active November 4, 2021 05:25
Vue.js Debugging in VS Code Extended
@socheatsok78
socheatsok78 / routes.js
Created October 26, 2021 05:40
Example routes meta for Breadcrumb
import { NestedRouteView } from '@soramitsukhmer/vuetify-plugin'
export default {
path: 'sessions',
meta: {
title: 'Session',
breadcrumb: {
text: 'Session'
}
},
@socheatsok78
socheatsok78 / install.sh
Last active October 19, 2021 08:08
Base VSCode Extensions for Frontend
code --install-extension EditorConfig.EditorConfig
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension octref.vetur
code --install-extension wix.vscode-import-cost
@socheatsok78
socheatsok78 / README.md
Last active October 16, 2021 13:04
The quickest way to execute code in WebWorker and self termination after finished the execution.

Example

execute(() => { 
    const uint = new Uint8ClampedArray(32)
    const random = crypto.getRandomValues(uint)
    return random
})

// Return Uint8ClampedArray(32) value
@socheatsok78
socheatsok78 / pass-slots.md
Created October 8, 2021 09:57 — forked from loilo/pass-slots.md
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

/**
* Get a random large number
*/
export const getRandomNumber = () => parseInt((Math.random() + "").split('.')[1])
/**
* Get random string identifier
*/
export const getRandomString = () => getRandomNumber().toString(36)
@socheatsok78
socheatsok78 / README.md
Last active August 25, 2021 01:39
Example of `are-you-ready-yet` used with `Comlink`
@socheatsok78
socheatsok78 / machine.js
Last active July 10, 2021 08:07
Traffic Light - XState Example
const pedestrianStates = {
initial: 'walk',
states: {
walk: {
on: {
PED_TIMER: 'wait'
}
},
wait: {
on: {

animationInterval

Usage

// Create an animation callback every second:
const stopInterval = animationInterval(1000, function (time) {
  console.count('Timer')
})
@socheatsok78
socheatsok78 / keymap.c
Created June 8, 2021 03:33 — forked from sachee/keymap.c
sachee dactyl keyboard layout
#include "Dactyl.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
#define _QWERTY 0
#define _NUMLAYER 1
enum custom_keycodes {
QWERTY,
NUMLAYER