Skip to content

Instantly share code, notes, and snippets.

View goto-bus-stop's full-sized avatar
🇵🇸

Renée goto-bus-stop

🇵🇸
View GitHub Profile
@goto-bus-stop
goto-bus-stop / fixed_zstring.hpp
Created June 19, 2020 13:48
A C++17 class that quacks like a `std::string` but is actually a null-terminated `char[N]`.
#pragma once
#include <array>
#include <cstddef>
#include <string_view>
/// A string type that takes a fixed amount of stack space.
template <typename Type, size_t Capacity> class basic_fixed_zstring {
static_assert(!std::is_array_v<Type>);
static_assert(std::is_trivial_v<Type> && std::is_standard_layout_v<Type>);
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/uppy.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/uppy.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const uppy = Uppy.Core({debug: true}).use(Uppy.Dashboard);
Swal.fire({ toast: true });
var createModuleFactory = /* -- snip -- */
var _$lazy_4 = createModuleFactory(function (module, exports) {
// lazy.js
console.log('lazy')
});
var _$conditional_3 = createModuleFactory(function (module, exports) {
// conditional.js
console.log('conditional')
});
@goto-bus-stop
goto-bus-stop / aoc-required.txt
Created April 16, 2019 09:08
minimum required files for running age of empires 2: the conquerors games
EBUEula.dll
ebueulax.dll
language.dll
language_x1.dll
language_x1_p1.dll
empires2.exe
Age2_x1/age2_x1.exe
Age2_x1/spectate.exe
Age2_x1/age.dll
Age2_x1/dplayerx.dll
@goto-bus-stop
goto-bus-stop / hook.c
Created January 15, 2019 12:09
minimal C function hooks for windows
#include <windows.h>
#include <assert.h>
#include <stdio.h>
#ifdef DEBUG
# define dbg_print(...) printf("[hook.c] " __VA_ARGS__)
#else
# define dbg_print(...)
#endif
@goto-bus-stop
goto-bus-stop / App.tsx
Created December 10, 2018 14:37
@uppy/react with typescript
import * as React from 'react'
import Uppy = require('@uppy/core')
import Tus = require('@uppy/tus')
import GoogleDrive = require('@uppy/google-drive')
import { Dashboard, DashboardModal, DragDrop, ProgressBar } from '@uppy/react'
import '@uppy/core/dist/style.css'
import '@uppy/dashboard/dist/style.css'
type Props = {}
import html from'nanohtml'
import morph from'nanomorph'
morph(document.body, html`
<body>
<div id="test">
<h1>Hello world</h1>
</div>
</body>
`)
// npm install babel-register
// node collect | less
const { spawn } = require('child_process')
const sp = spawn('node', ['--print-opt-source', 'fib.js'], {stdio: ['ignore', 'pipe', 'inherit']})
sp.stdout.pipe(process.stdout)
Package Size
@uppy/aws-s3
@uppy/aws-s3-multipart
@uppy/core
@uppy/dashboard
@uppy/drag-drop
@uppy/dropbox
@uppy/file-input
@uppy/form
@goto-bus-stop
goto-bus-stop / handleback.js
Created June 29, 2018 21:19
take a compiled handlebars template function, return the source string
// this is a terrible hack, don't look at it god please don't look at it
function noop () {}
var makePlaceholder = function (name) {
function helper () {
var args = []
for (var i = 0; i < arguments.length; i++) args.push(arguments[i])
var opts = args.pop()
var out = '{{'