Skip to content

Instantly share code, notes, and snippets.

View Bruce0203's full-sized avatar
💭
I am listening kawaii future bass music genre

Bruce0203 Bruce0203

💭
I am listening kawaii future bass music genre
View GitHub Profile
@Bruce0203
Bruce0203 / init.vim
Last active February 8, 2024 06:59
init.vim
syntax enable
filetype plugin indent on
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
Plug 'preservim/tagbar'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'vim-airline/vim-airline'
Plug 'frazrepo/vim-rainbow'
@Bruce0203
Bruce0203 / test.kt
Created July 19, 2023 11:01
korge prototype
```kotlin
import korlibs.time.*
import korlibs.korge.*
import korlibs.korge.scene.*
import korlibs.korge.tween.*
import korlibs.korge.view.*
import korlibs.image.color.*
import korlibs.image.format.*
import korlibs.io.file.std.*
import korlibs.korge.view.align.*
@Bruce0203
Bruce0203 / gist:10c74edb0effb92460ac65e634818d43
Created July 10, 2023 02:09
linguistics-chomsky google slide presentation
https://docs.google.com/presentation/d/1ezGsmADO2Zec4WgGFv1lOmJCQO7xZZKIFqi4qKDpOuA/edit#slide=id.gc6f73a04f_0_14
@Bruce0203
Bruce0203 / ang1
Last active June 3, 2023 11:32
mini game logic
miniGames:
MCdev:
spawnLocation:
world: games
x: -18.5
y: 41.0
z: 2.5
yaw: 0.0
pitch: 0.0
1,-1Location:
@Bruce0203
Bruce0203 / DoesHashMapWorkWithNonHashCodeEquals.kt
Last active April 3, 2023 07:59
DoesHashMapWorkWithNonHashCodeEquals.kt
import java.util.UUID
var isEqualsFunctionCalled = false
data class KeyObj(val uuid: UUID = UUID.randomUUID()) {
override fun equals(other: Any?): Boolean {
isEqualsFunctionCalled = true
return super.equals(other)
import java.util.UUID
import kotlin.system.measureTimeMillis
fun main() {
fun newRandomString() = UUID.randomUUID().toString()
val list = (0..100).map { newRandomString() }.toList()
val times = 100000
val a = measureTimeMillis {
repeat(times) {
list.forEach { }
@Bruce0203
Bruce0203 / FastIterator.kt
Last active March 13, 2023 09:30
performance optimized forEach in Kotlin (exclude LinkedList case)
inline fun <T> List<T>.fastForEach(callback: (T) -> Unit) {
var n = 0
while (n < size) callback(this[n++])
}
inline fun <T> Array<T>.fastForEach(callback: (T) -> Unit) {
var n = 0
while (n < size) callback(this[n++])
}
miniGames:
테스트:
maxPlayers: 20
maxStartPlayers: 1
waitForStartTime: 100
gameTime: 100
repeatList:
- wait
- timer
repeats:
<div>
<canvas id="myChart"></canvas>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
@Bruce0203
Bruce0203 / index.html
Created July 26, 2022 05:57
picots sample
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello</title>
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
</head>
<body>