Skip to content

Instantly share code, notes, and snippets.

View sonictk's full-sized avatar
🤞
build.bat and hope everything works

Siew Yi Liang sonictk

🤞
build.bat and hope everything works
View GitHub Profile
//
// 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
//
//
@mmozeiko
mmozeiko / hook.c
Last active March 14, 2024 05:33
reads process stdout + stderr and prints it out as it becomes available
// compile this to hook.dll
// for example, with MSVC: cl.exe /LD /MT /O2 hook.c /Fehook.dll
#include <windows.h>
// get this from https://github.com/kubo/plthook
#include "plthook_win32.c"
static plthook_t* hook;
@cboddy
cboddy / thunderbird_to_mutt.py
Created October 8, 2016 15:29
A script to parse a csv address-book export from thunderbird and create mutt-aliases for each contact.
"""parse a csv address-book export from thunderbird and create mutt-aliases for each contact"""
import csv
import collections
import argparse
Contact = collections.namedtuple("Contact", ["first", "last", "email"])
def line_to_contact(line):
"""return: Contact based on csv line"""
@yamahigashi
yamahigashi / pyapi2_bulk_parentConstraint.py
Created February 1, 2016 11:10
maya python api 2.0 exploration, banned PyMel / maya.cmds
# -*- coding: utf-8 -*-
import re
import anyconfig
from maya.api import OpenMaya as OpenMaya2
##############################################################################
@bellbind
bellbind / Shaders.metal
Last active October 26, 2021 16:02
[swift][osx] Metal programming with commandline (Xcode less)
//-*- mode: c++ -*-
// build:
// xcrun -sdk macosx metal -std=osx-metal1.1 Shaders.metal -o shaders.air
// xcrun -sdk macosx metal-ar rcs Shaders.metalar Shaders.air
// xcrun -sdk macosx metallib -o Shaders.metallib Shaders.metalar
#include <metal_stdlib>
kernel void square(const device float* input [[buffer(0)]],
device float* output [[buffer(1)]],
metal::uint id [[thread_position_in_grid]]) {

Last updated 2020/03/04

Some links from twitter on the topic of parsing PSD files (haven't looked into them in details). PSD include a flattened rasterized image so this is easy to load if that's the only thing you need. Most software / librairies have support for extracting this flattened data (e.g. stb_image.h does).

However if you want access to individual layers, render non-rasterized layers, emulate every photoshop features, extract or apply effects with more granularity, more code is needed. May range from easy to lots-of-work depending on what exactly you need.

As far as I know there isn't a trivial stb-like ready-to-use C++ library to do that sort of things. Posting all links here. Some are probably bloated or hard to use into your project, some lacking features.

TODO: Actually look into the pros/cons of all those.

@Rod-Persky
Rod-Persky / CMakeLists.txt
Last active January 31, 2024 12:57
Example cmake for windows including auto copy dll
# _______ __ __ _______ ______ _______ _______ _______ ______ #
#| || | | || || | | _ || || || | #
#| _ || | | ||_ _|| _ || |_| ||_ _|| ___|| _ |#
#| | | || |_| | | | | | | || | | | | |___ | | | |#
#| |_| || | | | | |_| || | | | | ___|| |_| |#
#| || | | | | || _ | | | | |___ | |#
#|_______||_______| |___| |______| |__| |__| |___| |_______||______| #
# #
# Modern CMake practices and importing the QT scripts by adding it to #
# your module path makes things a lot better than it used to be #
@mburr
mburr / runcl.cmd
Last active January 23, 2023 19:45
runcl.cmd - simple compiler driver - mburr #cmd
@echo off
goto end_comments
rem --------------------------------------------------------
Find the most recent version of this: https://gist.github.com/mburr/3308168
This script helps integrate compilers into UltraEdit or other editors
The first parameter is an ID for the compiler to use (vc60, vc71, vc80, etc.)