Skip to content

Instantly share code, notes, and snippets.

View codecat's full-sized avatar
🌸
Meow

Melissa codecat

🌸
Meow
View GitHub Profile
@codecat
codecat / imgur-uploader
Created July 4, 2012 22:23 — forked from robertbasic/imgur-uploader
xfce4-screenshooter to imgur
#!/bin/bash
# Ubuntu Keyboard settings shortcut:
# xfce4-screenshooter -r -o "sh /location/to/imgur-uploader.sh"
API_KEY=YOUR_API_KEY_GOES_HERE
URL=http://api.imgur.com/2/upload
RESPONSE=$(curl -s -F "key=$API_KEY" -F "image=@$1" $URL)
echo "$RESPONSE" | grep -o -E "<original>.*</original>" | grep -o -E "http://.*\.png" | xsel -i -b
@codecat
codecat / vm.cpp
Last active April 16, 2017 12:15
16 bit bytecode VM
//
// This is an incomplete VM that runs 16 bit bytecode written in C++.
// It's very basic and probably lacks a lot, so this is not to be used in production at all.
// It was however fun to write, so I provide this as a Gist.
//
// https://github.com/codecat
//
#include <cstdio>
#include <cstdint>
@codecat
codecat / BugReproduceSteps.md
Last active May 11, 2018 16:28
MSVC 2017 optimization bug

This is reproduced on Visual Studio 2017 15.7.1.

  1. Download Angelscript from here: http://www.angelcode.com/angelscript/sdk/files/angelscript_2.32.0.zip
  2. Extract it to some folder, for me this is D:\Dev\msvc_bug_test
  3. Open sdk/angelscript/projects/msvc2015/angelscript.sln in Visual Studio 2017
  4. It will ask to upgrade the project to SDK 10.0.17134.0 and toolset v141, so we do that
  5. We switch the build to Release and build the project
  6. Close the Visual Studio solution, and make a new solution/project, I'll call it bugtest
  7. Switch to Release configuration
  8. Switch the runtime library to /MT in order to match Angelscript
@codecat
codecat / Schedule.md
Last active June 20, 2018 19:00
Defqon 2018 Livestream Schedule

Defqon 1 2018 Livestream Schedule

Available streams:

  • Q-Dance Live (Video & Audio) - Multiple stages. There's currently no schedule available.
  • Red Stage (Video & Audio) - Member only. Sign up for free on Q-Dance.com.
  • Blue Stage (Video & Audio) - Member only. Sign up for free on Q-Dance.com.
  • Black Stage (Video & Audio) - Member only. Sign up for free on Q-Dance.com.
  • Q-Dance Radio (Audio only) - Multiple stages. There's currently no schedule available.

/r/hardstyle Discord chat: https://discord.gg/hardstyle

@codecat
codecat / genie_zstd.lua
Created July 10, 2018 10:04
GENie/premake build for Facebook's zstd library
-- This GENie file copies the behavior of the Makefile in the lib folder.
-- Basic usage: project_zstd(ZSTD_DIR)
function project_zstd(dir, compression, decompression, deprecated, dictbuilder, legacy)
if compression == nil then compression = true end
if decompression == nil then decompression = true end
if deprecated == nil then deprecated = false end
if dictbuilder == nil then dictbuilder = false end
if legacy == nil then legacy = 0 end
@codecat
codecat / use_wxwidgets.lua
Created February 16, 2020 16:45
wxWidgets Premake5
-- NOTE:
-- This script was taken from: https://wiki.wxwidgets.org/Premake4
-- And modified by Miss to fix some issues and work with Premake5
--
-- Use like:
-- flags "WinMain"
-- configuration "Debug"
-- wx_config { Root=WX_DIR, Debug="yes", Static="yes", Unicode="yes", Version="3.1", Libs="core,adv,gl,aui,propgrid" }
-- configuration "Release"
-- wx_config { Root=WX_DIR, Debug="np", Static="yes", Unicode="yes", Version="3.1", Libs="core,adv,gl,aui,propgrid" }
@codecat
codecat / Webservices.md
Last active May 11, 2024 22:51
Trackmania Webservices

New documentation

Note: There is a newly maintained community documentation site for all of Trackmania's APIs!

Visit it at: https://webservices.openplanet.dev/

Authentication setup

This guide will explain how to authenticate with Nadeo's API. There are 2 methods of doing so, one is via a Ubisoft account, and one is via a dedicated server account. Note that the dedicated server account way is easier but imposes some limitations on what you can access with the API, but it could be enough.

Refer to my Nadeo Go package for a complete example.

@codecat
codecat / BeamNG.Hooks.md
Last active August 27, 2024 02:31
BeamNG Extension hooks

BeamNG Extension hooks

These are called in extensions. For example, the following module has some hooks:

local M = {}

M.onBeamNGTrigger = function(data)
	-- ...
end
@codecat
codecat / TeensyLed.c
Created July 3, 2021 14:26
Teensy program for my LED strips.
/*
Required Connections
--------------------
pin 2: LED Strip #1 OctoWS2811 drives 8 LED Strips.
pin 14: LED strip #2 All 8 are the same length.
pin 7: LED strip #3
pin 8: LED strip #4 A 100 ohm resistor should used
pin 6: LED strip #5 between each Teensy pin and the
pin 20: LED strip #6 wire to the LED strip, to minimize
pin 21: LED strip #7 high frequency ringining & noise.
@codecat
codecat / gamelogin.go
Created June 6, 2022 15:45
Converting between Nadeo account ID and encoded game logins
package main
import (
"encoding/base64"
"encoding/hex"
"regexp"
"strings"
)
func isUUID(id string) bool {