Skip to content

Instantly share code, notes, and snippets.

View JCash's full-sized avatar
💭
Game devving 24/7

Mathias Westerdahl JCash

💭
Game devving 24/7
View GitHub Profile
@JCash
JCash / make_gif_from_video.sh
Created July 17, 2016 10:12
A quick way to convert Defold video (.ivf) into a compressed .gif
#!/usr/bin/env bash
FPS=15
SIZEPX=320
STARTTIME=0
DURATION=0
PALETTE="/tmp/palette.png"
TMPGIF="/tmp/$2"
[
{ "keys": ["alt+tab"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm", "vsh", "fsh"]} },
{ "keys": ["super+shift+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"github"} },
{ "keys": ["ctrl+§"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }
]
{
"shell_cmd": "./waf",
"working_dir": "$folder",
"file_regex": "\\.\\.\\/(.+?):(\\d+):(\\d+)"
}
@JCash
JCash / jc::hashtable_chaining.h
Created March 27, 2016 09:15
A small, fast, cache friendly hash table using chaining
#pragma once
/** A small hash table
*
* - The memory must be allocated by the user
* - It cannot grow
* - It asserts when putting an item into a full table
* - Supports keys with % and == operators
* - Supports values with = operator
*/
@JCash
JCash / namegenerator.cpp
Last active August 29, 2015 14:13
Name Generator
#include <alloca.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
/* Implementation of Nolithius' name generator:
* Demo: http://www.nolithius.com/game-development/weightedletter-name-generator
* Code: https://code.google.com/p/weighted-letter-namegen
@JCash
JCash / p4init.py
Last active December 12, 2015 01:19
Python API startup
try:
from P4 import P4, P4Exception
p4 = P4()
p4.connect()
print p4.client
except P4Exception, e:
print "P4 Error", str(e)