Skip to content

Instantly share code, notes, and snippets.

View misdake's full-sized avatar

misdake misdake

  • Shanghai
  • 10:19 (UTC +08:00)
  • X @rSkip
View GitHub Profile
/*
* Simple script for running emcc on ARToolKit
* @author zz85 github.com/zz85
*/
var
exec = require('child_process').exec,
path = require('path'),
fs = require('fs'),
#If GetKeyState("CapsLock", "T") = 1
w::SendInput {Ctrl Down}{Shift Down}{Tab Down}
w up::SendInput {Ctrl Up}{Shift Up}{Tab Up}
r::SendInput {Ctrl Down}{Tab Down}
r up::SendInput {Ctrl Up}{Tab Up}
a::SendInput {Blind}{Home Down}
a up::SendInput {Blind}{Home Up}
g::SendInput {Blind}{End Down}
g up::SendInput {Blind}{End Up}
@misdake
misdake / gist:a32c91c11a1f422127797c605ca5ca53
Created June 13, 2021 10:52
Load custom levels for forknjoin
window.loadlevel({
name: "Help each other",
maxtime: 25,
goldtime: 17,
map: [
w, w, w, w, w, w, w, w, w,
w, w, w, w, w, w, w, w, w,
w, o, o, o, c, o, o, o, w,
w, o, w, w, U, w, w, w, w,
P, o, w, w, o, w, o, o, Z,
@misdake
misdake / main.rs
Created May 2, 2022 02:34
Rust Lifetime Annotation
fn select_u32<'a>(a: &'a u32, b: &'a u32, select_a: &'a bool) -> &'a u32 {
if *select_a { a } else { b }
}
const STR_A: &'static str = "A";
const STR_B: &'static str = "B";
fn select_str(s: &str) -> &str {
if s.is_empty() { STR_A } else { STR_B }
}