Skip to content

Instantly share code, notes, and snippets.

View bruxisma's full-sized avatar
🔮

Izzy Muerte bruxisma

🔮
View GitHub Profile
@bruxisma
bruxisma / CMakeLists.txt
Last active August 9, 2023 20:43
AppImage + CPack Experiment
# This isn't meant to be a fully featured implementation. It's just a small playground project.
# Use `cmake -Bbuild -S. -GNinja` to generate the project
# Then use `cmake --build build --target package` to generate a .appimage file ready to go
# This project DOES do dangerous things and tries to download the linuxdeploy tool directly.
# When this makes it into IXM, it will be expected that users have the linuxdeploy tool installed to *some* location.
# It will NOT download and execute something from the internet.
cmake_minimum_required(VERSION 3.16)
project(summon-test LANGUAGES CXX VERSION 0.1.0)
add_executable(app)
@bruxisma
bruxisma / fzy.vim
Created November 1, 2019 16:25
port of fzy/fzy.js to vimscript
let s:score_min = float2nr(-1/0.0) + 0.0
let s:score_max = float2nr(1/0.0) + 0.0
let s:score_gap_trailing = -0.005
let s:score_gap_leading = -0.005
let s:score_gap_inner = -0.01
let s:score_match_consecutive = 1.0
let s:score_match_slash = 0.9
let s:score_match_word = 0.8
let s:score_match_capital = 0.7
@bruxisma
bruxisma / README.md
Created April 22, 2019 21:14
Minimal WASM C++ Test

Minimal WASM C++ Test

I spent a lot of hair tearing to figure out the minimal amount of work needed to get some C++ to output to HTML.

Simply clone this gist into a directory and everything should be good to go. You can run the build.sh file after a chmod +x, or just run the command manually. Anything goes, really.

This was written on April 22nd, 2019. Things are apparently changing enough that this might not be valid in the future. A lot of the work is handled by the wasm-ld tool, rather than by clang. It makes me wonder if something like CMake integration is even possible. That said, this code was run and tested on windows, in addition to linux and macOS. I used the 8.0 release of clang.

@bruxisma
bruxisma / CMakeLists.txt
Created April 10, 2019 22:32
GNU Make 4.2 for Windows (MinGW Confirmed)
cmake_minimum_required(VERSION 3.13)
project(gnu-make LANGUAGES C)
find_package(Threads REQUIRED)
# Currently builds without GNU Guile support.
if (WIN32)
configure_file(config.h.W32 ${PROJECT_BINARY_DIR}/config.h COPYONLY)
endif()
@bruxisma
bruxisma / CMakeLists.txt
Last active July 10, 2019 09:03
How to use Shlwapi to find your SavedGames directory on Windows and stop using Documents\My Games in the year 2017
cmake_minimum_required(VERSION 3.14)
project(shlwapi-test)
add_executable(findit test.cxx)
target_compile_options(findit PRIVATE /std:c++latest)
#include <iostream>
#include <chrono>
#include <ctime>
using ::std::cout;
using ::std::endl;
namespace time {
using ::std::chrono::system_clock;
@bruxisma
bruxisma / spasm
Last active August 29, 2015 14:17
Download Twitch Broadcasts
#!/bin/sh
# This is a shell script to download a 'past broadcast' from twitch.tv and
# convert it to an MP4. Takes a channel and a number parameter, which is the
# which is the number in the url http://twitch.tv/<channel>/b/<number>
#
# If no parameter is provided, a list of up to 10 video ids combined with their
# dates and the game played will be printed.
#
# This requires the following tools:
# curl
@bruxisma
bruxisma / keybase.md
Created February 2, 2015 19:44
keybase.md

Keybase proof

I hereby claim:

  • I am slurps-mad-rips on github.
  • I am slurpsmadrips (https://keybase.io/slurpsmadrips) on keybase.
  • I have a public key whose fingerprint is DD2F E349 B0F3 DB21 001F BD1C FCB3 126A 7429 F095

To claim this, I am signing this object:

def progress_bar(iterable, fill='=', empty='.', size=60):
count = len(iterable)
def show(i):
x = int(size * i / count)
sys.stdout.write('[{0}{1}] {2}/{3}\r'.format(fill * x, empty * (size - x), i, count))
sys.stdout.flush()
show(0)
for i, item in enumerate(iterable):
yield item
show(i + 1)