Skip to content

Instantly share code, notes, and snippets.

@heylenz
heylenz / commit-message.sh
Created May 27, 2024 02:52 — forked from konsalex/commit-message.sh
Generate a commit message based on a changeset file 🦋 using ollama 🦙
#!/bin/bash
file=$(find ./.changeset/ -type f -name '*.md' | grep -E '^[./a-z-]+\.md$')
prompt_template=$(cat <<-END
You are a programmer, trained to write commit messages.
You follow the Conventional Commits specification.
feat: for new features
chore: for maintenance work
fix: for bug fixes
@heylenz
heylenz / integrating-fastbuild-with-ue4.md
Created June 6, 2022 10:09 — forked from hillin/integrating-fastbuild-with-ue4.md
Integrating FASTBuild with Unreal Engine 4

FASTBuild is an open-source distributed build system, which could be a free alternative to Incredibuild. Unreal Engine 4 (UE4) does not support FASTBuild natively, however it's not hard to integrate it manually.

Integrate FASTBuild with UE4

Install FASTBuild

We assume you already have the full UE4 source code. First you'll need to grab the latest FASTBuild tools from here. We use v0.93 Windows x64 version in this tutorial. Download it and extract all the files. Here you have several choices:

  • Place the files under any folder which could be found with your system's PATH environment variable. To see where these folders are, run the PATH command in a command prompt window;
  • Place the files under the Engine\Binaries\ThirdParty\FASTBuild folder of your engine. This is the recommended place;
  • Place the files anywhere you like. This is not recommended because you'll have to hard-code the path later.
@heylenz
heylenz / mayaToNumpy.py
Created September 1, 2020 15:49 — forked from tbttfox/mayaToNumpy.py
Blazing fast maya api types to Numpy conversion
from maya import OpenMaya as om
import numpy as np
from ctypes import c_float, c_double, c_int, c_uint
_CONVERT_DICT = {
om.MPointArray: (float, 4, c_double, om.MScriptUtil.asDouble4Ptr),
om.MFloatPointArray: (float, 4, c_float , om.MScriptUtil.asFloat4Ptr),
om.MVectorArray: (float, 3, c_double, om.MScriptUtil.asDouble3Ptr),
om.MFloatVectorArray: (float, 3, c_float , om.MScriptUtil.asFloat3Ptr),
om.MDoubleArray: (float, 1, c_double, om.MScriptUtil.asDoublePtr),
@heylenz
heylenz / sg_create_versions_from_files.py
Created January 20, 2020 11:51 — forked from surrealroad/sg_create_versions_from_files.py
Shotgun API script to facilitate Version creation from folder of files
#!/usr/bin/env python
# encoding: utf-8
"""
sg_create_versions_from_files.py
Create Versions in Shotgun from a folder of local files
• Create a new version with the name based on the filename
• Transcode the file and generate thumbnails and web-playable media
@heylenz
heylenz / axios-interceptors-refresh-token.js
Created June 5, 2019 16:30 — forked from mkjiau/axios-interceptors-refresh-token.js
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@heylenz
heylenz / generate_docker_cert.sh
Last active April 29, 2019 14:22 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@heylenz
heylenz / custom_row_renderer.jsx
Created March 29, 2019 03:10 — forked from thomasmery/custom_row_renderer.jsx
Adding props to a React Virtualized custom row renderer
/**
* External dependencies
*/
import React, { PureComponent, PropTypes } from 'react';
import { AutoSizer, Table } from 'react-virtualized';
/**
* Internal dependencies
**/
import getDefaultColumns from './columns'; // some columns for RV Table
@heylenz
heylenz / expired.js
Created November 22, 2018 16:02 — forked from srph/expired.js
axios + react-router: handling invalid tokens through axios interceptors
import axios from 'axios';
import cookie from 'cookie-machine';
import {hashHistory} from 'react-router';
axios.interceptors.response.use(null, function(err) {
if ( err.status === 401 ) {
cookie.remove('my-token-key');
hashHistory.push('/login');
}
@heylenz
heylenz / sqlalchemy_example.py
Created October 16, 2018 01:58 — forked from podhmo/sqlalchemy_example.py
sqlalchemy query example.
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)