Skip to content

Instantly share code, notes, and snippets.

View Mitscherlich's full-sized avatar
:shipit:
Beings Pals

Mitscherlich Wei Mitscherlich

:shipit:
Beings Pals
View GitHub Profile
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Incident Identifier: BC199217-975D-442B-9B09-919A3BAC60E0
CrashReporter Key: C493F646-0387-1109-DC41-9ABD64ECDFE5
Hardware Model: Mac15,10
Process: bh3 [56307]
Path: /Applications/崩坏3.app/Wrapper/bh3.app/bh3
Identifier: com.miHoYo.bh3
@Mitscherlich
Mitscherlich / snake.c
Created December 1, 2022 14:47
snake in windows console
#include <stdio.h>
#include <time.h>
#include <windows.h>
#include <stdlib.h>
#include <conio.h>
#pragma warning(disable : 4996) // 关闭警告
#define U 1
#define D 2
@Mitscherlich
Mitscherlich / bem.ts
Created February 24, 2022 07:21
createBEM helper
/**
* bem helper
* b() // 'button'
* b('text') // 'button__text'
* b({ disabled }) // 'button button--disabled'
* b('text', { disabled }) // 'button__text button__text--disabled'
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
*/
export type Mod = string | { [key: string]: any }
@Mitscherlich
Mitscherlich / Countdown.jsx
Created February 24, 2022 05:17
Simple Countdown Component (Vue 2)
import isNumber from 'lodash/isNumber';
import PropTypes from 'vue-types';
const MILLISECONDS_SECOND = 1000;
const MILLISECONDS_MINUTE = 60 * MILLISECONDS_SECOND;
const MILLISECONDS_HOUR = 60 * MILLISECONDS_MINUTE;
const MILLISECONDS_DAY = 24 * MILLISECONDS_HOUR;
const EVENT_VISIBILITY_CHANGE = 'visibilitychange';
const PropTypeNatural = PropTypes.custom(val => isNumber(val) && val >= 0);
@Mitscherlich
Mitscherlich / SimpleTimer.jsx
Created February 24, 2022 05:15
Simple Timer component (Vue 2)
import Vue, { VNode } from 'vue'
import isNumber from 'lodash/isNumber'
import PropTypes from 'vue-types'
const EVENT_VISIBILITY_CHANGE = 'visibilitychange'
const PropTypeNatural = PropTypes.custom((val: number) => isNumber(val) && val >= 0)
export const TimerProps = {
interval: PropTypeNatural.def(1000),
@Mitscherlich
Mitscherlich / event.ts
Created February 24, 2022 05:13
Simple Events Emitter
type EventHandlerFn = (...args: any[]) => void;
export interface EventHandler {
listener?: EventHandlerFn;
}
export interface EventListener {
[key: string]: EventHandlerFn[] | EventHandler[];
}
@Mitscherlich
Mitscherlich / 📊 Weekly development breakdown
Last active January 14, 2022 09:00
Weekly development breakdown
Vue.js 14 hrs 25 mins ████████████░░░░░░░░ 45.4%
JavaScript 9 hrs 32 mins █████████░░░░░░░░░░░ 30.0%
TypeScript 3 hrs 13 mins █████░░░░░░░░░░░░░░░ 10.1%
JSON 3 hrs 4 mins ████▓░░░░░░░░░░░░░░░ 9.7%
@Mitscherlich
Mitscherlich / proxy.html
Created March 3, 2021 05:55
Simple Proxy Compatibility Test.html
<!DOCTYPE html>
<html>
<head>
<meta chaset="utf-8" />
<!-- bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="container pt-4">
<div class="card">
@Mitscherlich
Mitscherlich / ngrok.dockerfile
Last active May 7, 2019 03:25
Dockerfile based on ngrok 1.7
FROM golang:alpine as builder
LABEL maintainer="Mitscherlich <mitscherlich36@gmail.com>" \
provider="hteen <i@hteen.cn>"
COPY . /tmp
# install ngrok dependencies
RUN apk add --no-cache git make openssl
# clone ngrok source code and build binary
@Mitscherlich
Mitscherlich / trash.sh
Last active April 18, 2019 05:03
shell script for trashing file(s) on macOS/Linux -- or so called 'safe rm'
#!/bin/sh
TRASH_DIR="$HOME/.Trash"
TRASH_HISTORY="$HOME/.trash_history"
if [ ! -d "$TRASH_DIR" ]; then
mkdir -p $TRASH_DIR
fi
stash() {
for path in "$@"; do