Skip to content

Instantly share code, notes, and snippets.

View SakuraHentai's full-sized avatar
🏠
Working from home

Derek SakuraHentai

🏠
Working from home
View GitHub Profile
@SakuraHentai
SakuraHentai / r3f-cursor-on-mesh.js
Created November 7, 2023 11:50
R3F ( React Three Fiber ) place plane on other mesh demo
import { useRef } from "react";
import { Canvas } from "react-three-fiber";
function Demo() {
const circleRef = useRef();
return (
<>
<mesh
rotation={[4, 0.3, -0.3]}
@SakuraHentai
SakuraHentai / crc64_be.js
Last active October 4, 2023 05:29
crc64
// ref: https://github.com/torvalds/linux/blob/master/lib/crc64.c#L51
function crc64(str) {
const CRC64_ECMA182_POLY = 0x42f0e1eba9ea3693n
// CRC64 lookup table
const crc64Table = []
for (let i = 0n; i < 256n; i++) {
let crc = 0n
let c = i << 56n
<svg viewBox="0 0 300 300" version="1.1">
<g>
<rect
x={0}
y={0}
width={20}
height={20}
fill="red"
id="show"
pointerEvents={'visible'}
@SakuraHentai
SakuraHentai / dnd-with-placeholder.vue
Last active June 8, 2021 06:30
dnd, sort in dst, drag from src
<template>
<div class="row">
<div class="col">
<h3>src</h3>
<div>
<div
v-for="el in srcList"
:key="el.id"
draggable="true"
@dragstart="dragStart(el.id, $event)"
package main
import (
"fmt"
"strconv"
"strings"
)
const pwdLen = 4