Skip to content

Instantly share code, notes, and snippets.

View LB--'s full-sized avatar

LB--

  • Clickteam
View GitHub Profile
package net.adamqpzm.steadfast;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class Steadfast extends JavaPlugin implements Listener {
@LB--
LB-- / ResonanceCascade.cpp
Created September 6, 2015 00:17
C++ supports multiple active exceptions at once - see it in action at http://melpon.org/wandbox/permlink/PscHg988AnzjajyS
#include <iostream>
#include <stdexcept>
#include <exception>
struct ResonanceCascade final
{
ResonanceCascade()
{
std::cout << "ResonanceCascade ctor" << std::endl;
}
@LB--
LB-- / not in base 3
Created October 3, 2013 05:11
not in base 3 - One summer's day, long ago, I joined ClickConverse and was presented with an opportunity I could not pass up. It turned out better than I expected, and even funnier than I expected for the people that witnessed it. I'm just reposting this here since I'm not too trusting of pastebin.
[23:55] LB has entered the room
[23:55] <liquixcat> yeah cause 1111 is 15
[23:55] <Looki> like, the highest bit set
[23:55] <LB> not in base 3
[23:55] <Looki> is the magnitude
[23:55] LB has left the room
[23:56] <Looki> yo LB
[23:56] <RootKernel> xD
[23:56] <Looki> oh sh
[23:56] <RootKernel> quick draw
#include <iostream>
#include <tuple>
namespace
{
template<typename T>
using identity = T;
template<typename T, typename... V>
struct RAII_Set_impl
#include <stdio.h>
#include <fcntl.h>
#if defined(__unix__) || defined (__CYGWIN__)
#include <unistd.h>
#else
#include <io.h>
#endif
#ifndef O_BINARY
@DavidEGrayson
DavidEGrayson / ubsan_shell_session.txt
Last active May 30, 2016 03:26
Sadly -fsanitize=undefined does not work in MSYS2/mingw-w64. Cannot find -lubsan at link time.
$ cat test.c
int main() { return 0; }
$ gcc -v -fsanitize=undefined test.c
Using built-in specs.
COLLECT_GCC=D:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-5.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/5.2.0 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=
@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-- / 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
@LB--
LB-- / CMakeLists.txt
Last active August 11, 2019 17:17
CMake Bootstrap
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
ExternalProject_Add(CMake
GIT_REPOSITORY "git://github.com/Kitware/CMake.git"
# GIT_TAG "next"
CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_LIST_DIR}/install"
# "-DBUILD_SHARED_LIBS=OFF"
TEST_EXCLUDE_FROM_MAIN 1
@tamaskenez
tamaskenez / make_config_modules_relocatable.cmake
Last active March 24, 2020 12:17
converts the absolute paths found in CMake config-modules to paths relative to the root of the install tree
# This script fixes the absolute paths, which reference a file within
# a tree (usually the install dir).
#
# It's only input parameter is the root directory (usually the dir set as
# CMAKE_INSTALL_PREFIX).
#
# First it globs all the *.cmake file within the directory.
# Scans them for the root dir.
# If found, introduces a new INSTALL_PREFIX_... variable in the script,
# derived from the location of that script and replaces all references to