Skip to content

Instantly share code, notes, and snippets.

int init()
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) {
app.window = SDL_CreateWindow(GAME_TITLE, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (int)SCREEN_WIDTH, (int)SCREEN_HEIGHT, 0);
if (app.window != NULL) {
app.renderer = SDL_CreateRenderer(app.window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
// app.renderer = SDL_CreateRenderer(app.window, -1, SDL_RENDERER_ACCELERATED);
if (app.renderer != NULL) {
@jfcherng
jfcherng / st4-changelog.md
Last active August 18, 2024 07:25
Sublime Text 4 changelog just because it's not on the official website yet.
@ryanfleury
ryanfleury / obj_parse.h
Last active October 5, 2021 22:59
Single-header OBJ Parser (WIP)
// ----------------------------------------------------------------------------
// Single Header Wavefront OBJ Parser, by Ryan Fleury
// ----------------------------------------------------------------------------
//
// This is a single-header Wavefront OBJ parsing library that is both C99+ and
// C++ compatible. There are two APIs that you can use. One of which is lower
// level and more shippable, and the other is high level and less shippable,
// but is nice to get things off the ground.
//
// To use this file, you must #define OBJ_PARSE_IMPLEMENTATION in at least ONE
@Symbianx
Symbianx / darkify-slack-for-windows.sh
Last active August 1, 2019 14:07
Changes the Slack for Windows theme to dark.
#!/bin/bash
set -e
# Darkify Slack on Mac OS or Linux.
# curl https://gist.githubusercontent.com/Symbianx/7624c96102b9fc8d1ff396e8fe0c12e6/raw/darkify-slack-for-windows.sh | sh
cd "/c/Users/`cmd.exe /c 'echo %username%' | tr -d '\r\n'`/AppData/Local/slack/"
for VERSION_DIR in app-*; do
if [ -d "${VERSION_DIR}" ]; then
# Will not run if no directories are available
@cuu
cuu / expand_rootfs
Last active May 26, 2023 05:30
expand_rootfs for gameshell
#!/bin/sh
### BEGIN INIT INFO
# Provides: expand_rootfs
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Expand the root filesystem to fill partition
# Description:
### END INIT INFO
@d7samurai
d7samurai / .readme.md
Last active March 19, 2025 22:39
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube

hollowcube

Other gists in this series:

Keybase proof

I hereby claim:

  • I am beast2013 on github.
  • I am beast2013 (https://keybase.io/beast2013) on keybase.
  • I have a public key ASCcczGz7BYBvn7_9MQXooAbkFpNeSwNGbNZnuaAoz14bgo

To claim this, I am signing this object:

@andrewrk
andrewrk / microsoft_craziness.h
Created September 1, 2018 14:35
jonathan blow's c++ code for finding msvc
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@carolosf
carolosf / midi.sh
Created February 24, 2018 18:17
Nice mappings for FL Studio 12 and my M-Audio Axiom air 32 mini
#!/bin/bash
# Nice mappings for FL Studio 12 and my M-Audio Axiom air 32 mini
# aseqdump -l
# aseqdump -p "Axiom A.I.R. Mini32"
# sudo apt install xdotool
aseqdump -p "Axiom A.I.R. Mini32" | \
while IFS=" ," read src ev1 ev2 ch label1 data1 label2 data2 rest; do
#echo "$srsc $ev1 $ev2 $ch $label1 $data1 $label2 $data2 $rest"
case "$ev1 $ev2 $data1 $data2" in
"Control change 17 127" ) xdotool key space ;;
@ThisIsOstad
ThisIsOstad / Chrome 61 Backup Saved Passwords
Last active September 12, 2020 18:00
As Chrome removed the "Backup" button in "Saved Passwords", you can make a backup from your passwords by running this code in the console!
// 1. Open chrome://settings/passwords
// 2. Open chrome developer tools (using F12 or Ctrl+Shift+i)
// 3. Run the following code in the console tab
// 4. Copy output in a text file and save it somewhere safe!
function asyncForEach(array, done, iterator) {
var i = 0;
next();
function next(err) {
if (err) {