Skip to content

Instantly share code, notes, and snippets.

View LB--'s full-sized avatar

LB--

  • Clickteam
View GitHub Profile
@LB--
LB-- / overload-specify.cpp
Created March 22, 2018 03:36
I'm working on an implementation of std::overload. This version requires that you specify the argument types for the callables, but it works on anything that can be called. Also handles const-correctness thanks to SFINAE. If you comment out line 69, GCC optimizes it to `return 10;`: https://godbolt.org/g/2GFgFX
#include <variant>
namespace impl
{
template<typename T, typename Callable>
struct Overload
{
Callable callable;
auto operator()(T &t) noexcept(noexcept(callable(t)))
{
@LB--
LB-- / overload-simple.cpp
Last active March 22, 2018 02:35
I'm working on an implementation of std::overload. This is a simple ugly hacky version that only works with plain functions or +lambdas.
#include <variant>
template<typename R, typename Arg>
using unary_func = R (*)(Arg);
template<typename R, typename... Arg>
struct Callable final
{
std::add_pointer_t<void> const funcs[sizeof...(Arg)];
template<typename GivenArg, std::size_t Index = 0>
static constexpr std::size_t index_of()
@LB--
LB-- / convert.cmake
Last active March 31, 2018 04:09
A script I use to format my OBS Studio video recordings for upload to Twitch and YouTube. Requires ffmpeg.
cmake_policy(VERSION 3.10)
if(NOT DEFINED SOURCE)
message(FATAL_ERROR "-DSOURCE=")
endif()
if(NOT DEFINED DEST)
set(DEST ".")
endif()
@LB--
LB-- / Duskers-bugs.md
Last active January 23, 2023 15:19
List of bugs in Duskers with video examples. Steam has a max character limit for reviews.

See the full review here: Duskers review

All bugs on this list have happened to me or someone else on video at least once. The ones without video examples are common enough or easily reproducable enough that there would be too many examples. Consider that there aren't many videos on Duskers from which to construct this list, and remember that there are many more players who have purchased the game than there are YouTubers who upload video recordings of Duskers. Every bug is likely to have happened many more times to people who never reported the bug or didn't have video evidence of it.

This list was originally created when v1.041 was the latest version. There have since been several new versions that have fixed dozens of bugs. I have gone through and removed bugs that I believe are fixed now, but there may still be a few on this list that have already been fixed. If you know for sure, let me kno

@LB--
LB-- / duskers-alias.txt
Last active April 10, 2023 04:52
My command aliases in Duskers
begin=open r1;navigate 1 2 a1; generator 2; status
end=navigate all r1
gg=gather
h=gather
sg=sensor;gather
qq=teleport 1 r1;teleport 2 r1;teleport 3 r1;teleport 4 r1;transport 1 2 3 4 r1
explore=teleport 1 $r; scan 1; probe 1; info 1; gather 1 all
check=sensor; teleport 1 sensor $r
move=teleport 1 sensor $r
fetch=navigate $x $r; tow $x; navigate $x r1
@LB--
LB-- / README.md
Created February 1, 2017 21:21
Executable configuration file for Portal 2 PeTI maps that skips walking up the stairs from the elevator.
  1. navigate to your Portal 2 installation folder (from within Steam you can use the Browse Local Files button)
  2. navigate to /portal2/cfg/ and create the skipintro.cfg file and copypaste from this gist
  3. run the game, open the console, and bind a key to exec skipintro - for example: bind t "exec skipintro"

When you load a puzzlemaker or beemod map, you can use the keybind as soon as the map loads. Do not use it after having already entered the map. Beemod maps with preplaced gel might get double-coated, but it should be mostly harmless.

#items { overflow: hidden !important; }
*:not(.yt-chat-badge):not(.yt-emoji-icon) { background: transparent !important; }
.gaming-promo, #live-comments-controls, ::-webkit-scrollbar, wbr, .is-deleted, [is-deleted], #panel-pages, yt-live-chat-header-renderer { display: none !important; }
#author-name, #message { color: white !important; text-shadow: -0.5px -0.5px 0 black, 0.5px -0.5px 0 black, -0.5px 0.5px 0 black, 0.5px 0.5px 0 black !important; }
#message { display: block !important; }
#author-name::after { content: ":"; font-weight: 900; }
#message a {color: skyblue !important; font-size: 0 !important; line-height: 9px !important;}
#message a::after { content: attr(href); font-size: 10px !important; }
@keyframes chat-fade { 0% { opacity: 1; position: relative; } 99% { opacity: 0; position: relative; } 100% { opacity: 0; position: absolute; }}
yt-live-chat-text-message-renderer { animation: chat-fade 5s 30s forwards; }
@LB--
LB-- / CONTRIBUTING.md
Last active July 5, 2016 14:48
My personal contributing guidelines

git

  • Read the license! Understand that your contribution will exist under the terms of the license and that as a result you may be giving up ownership of your code!
  • Preserve history! Only rebase or squash as told to do so in this guide. We don't care about the way commit graphs look.
  • Every commit must compile! This helps with bisecting, among other things.
  • When adding a new feature, base your work on the oldest commit that will allow your new code to compile and run as intended. This helps with merging specific features into older versions.
  • When fixing bugs, base the fix on the commit that introduced the bug. This helps with merging in bugfixes into older versions for bugfix releases.
  • When changing behavior, base your work on the most recent commit that changed or introduced the behavior. This helps with reverting changes for specially-made old versions, as well as making it easy to trace all the ways something has changed.
  • When removing code, base your work on the most recent commit that chang
@LB--
LB-- / heart.cpp
Created May 8, 2016 05:19
Mother's Day C++ Heart
#include <cmath>
#include <iostream>
#include <vector>
static constexpr std::double_t PI = std::acos(-1.0);
static constexpr std::size_t SIZE_X = 100;
static constexpr std::size_t SIZE_Y = 50;
static constexpr std::double_t STEP = 0.01;
static constexpr std::double_t MAX = PI*2.0;
@LB--
LB-- / LICENSE
Last active July 17, 2018 00:33
LB's Windows Unicode Helper Functions - convert between UTF-8 and UTF-16/Unicode on Windows
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit