Skip to content

Instantly share code, notes, and snippets.

@exjam
exjam / main.rs
Created June 8, 2022 19:11
rose-gltf
use bytes::{BufMut, BytesMut};
use gltf_json as json;
use json::validation::Checked::Valid;
use rose_file_readers::{RoseFile, VfsFile, ZmsFile};
use std::{borrow::Cow, collections::HashMap, path::PathBuf};
fn align_to_multiple_of_four(n: &mut u32) {
*n = (*n + 3) & !3;
}
@bkaradzic
bkaradzic / why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md
Last active April 5, 2024 05:40
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@deehzee
deehzee / psycopg2_sshtunnel.py
Last active September 13, 2023 08:09
How to Connect To PostgreSQL Using SSHTunnelForwarder and Psycopg2
import psycopg2
from sshtunnel import SSHTunnelForwarder
# For interactive work (on ipython) it's easier to work with explicit objects
# instead of contexts.
# Create an SSH tunnel
tunnel = SSHTunnelForwarder(
('128.199.169.188', 22),
ssh_username='<username>',
@tmrk
tmrk / countries.js
Last active May 13, 2022 08:34
An array of all countries with ISO 3166-1 alpha-2, alpha-3 and numeric country codes, as well the numeric codes for sub-regions, regions and continents as specified by the United Nations Statistics Division at http://unstats.un.org/unsd/methods/m49/m49.htm (Updated May 2022).
var countries = [
{ 'name' : 'Afghanistan', 'alpha2' : 'AF', 'alpha3' : 'AFG', 'num3' : '004', 'subregion' : '034', 'region' : '', 'continent' : '142' },
{ 'name' : 'Åland Islands', 'alpha2' : 'AX', 'alpha3' : 'ALA', 'num3' : '248', 'subregion' : '154', 'region' : '', 'continent' : '150' },
{ 'name' : 'Albania', 'alpha2' : 'AL', 'alpha3' : 'ALB', 'num3' : '008', 'subregion' : '039', 'region' : '', 'continent' : '150' },
{ 'name' : 'Algeria', 'alpha2' : 'DZ', 'alpha3' : 'DZA', 'num3' : '012', 'subregion' : '015', 'region' : '', 'continent' : '002' },
{ 'name' : 'American Samoa', 'alpha2' : 'AS', 'alpha3' : 'ASM', 'num3' : '016', 'subregion' : '061', 'region' : '', 'continent' : '009' },
{ 'name' : 'Andorra', 'alpha2' : 'AD', 'alpha3' : 'AND', 'num3' : '020', 'subregion' : '039', 'region' : '', 'continent' : '150' },
{ 'name' : 'Angola', 'alpha2' : 'AO', 'alpha3' : 'AGO', 'num3' : '024', 'subregion' : '017', 'region' : '', 'continent' : '002' },
{ 'name' : 'Anguilla', 'alpha2' : 'AI', 'alpha3' : 'AIA', 'num3' :
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active May 11, 2024 03:22
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@alfredo
alfredo / gist:1542184
Created December 31, 2011 00:24
Install node.js and coffee-script inside a python virtualenv
To install node.js and coffee-script inside a virtualenv and keep it self-contained:
1. Activate the virtualenv::
$ workon test
2. Move inside the virtualenv directory::
(test)$ cdvirtualenv