Skip to content

Instantly share code, notes, and snippets.

View sr8e's full-sized avatar
🎳
Full of temptation

しらす sr8e

🎳
Full of temptation
View GitHub Profile
@sr8e
sr8e / hexmap.py
Last active December 13, 2023 15:15
Hexmap (Tsukuba) distance
import math
from collections import deque
from typing import NamedTuple
import matplotlib.pyplot as plt
class ObliqueVector(NamedTuple):
xi: int
eta: int
@sr8e
sr8e / App.vue
Last active April 12, 2023 16:09
sample of two-way binding using v-model on multiple checkbox component (for Vue 3.x)
<script>
import MultiCheckbox from "./MultiCheckbox.vue"
import MultiCheckboxProp from "./MultiCheckboxProp.vue"
export default {
components: { MultiCheckbox, MultiCheckboxProp },
data(){
return{
checkList: [],
checkListProp: []
}
# bit-reversed increment sample. See: https://mell0w-5phere.net/jaded5phere/2023/03/23/bit-reversed-increment/
import time
def bit_reverse_naive(bits):
table = [0 for _ in range(1 << bits)]
for i in range(1 << bits):
s = 0
for j in range(bits):
if bits > 2 * j:
@sr8e
sr8e / keybase.md
Last active February 7, 2020 08:37

Keybase proof

I hereby claim:

  • I am sr8e on github.
  • I am sr_ on keybase.
  • I have a public key ASBIKOjul0ye2q05Oqz0kAUVQFUyNPN2aGDsrO9oCGBh8go

To claim this, I am signing this object: