Skip to content

Instantly share code, notes, and snippets.

@codewings
codewings / remove_unreal_app_icons.md
Last active May 13, 2024 16:06
Remove unwanted unreal app icon from launchpad

1.Enter Sqlite3

cd $(getconf DARWIN_USER_DIR)/com.apple.dock.launchpad/db
sqlite3 --column --head db

2.Delete record from 'apps'

delete from apps where title='<CASE_SENSITIVE_APPNAME>';

delete from apps where title='EpicWebHelper';
@codewings
codewings / backup_vscode_macos.sh
Created December 20, 2021 14:40
Backup my VSCode settings/extensions
code --list-extensions | xargs -L 1 echo code --install-extension > ~/install_vscode_extensions.sh
chmod +x ~/install_vscode_extensions.sh
cd ~/Library/Application\ Support/Code/User
tar -czf vscode_config.tar.gz *.json
mv vscode_config.tar.gz ~/vscode_config.tar.gz
@codewings
codewings / ffmpeg_concat.py
Last active October 14, 2022 13:47
ffmpeg_concat.py
import os
import re
def sorted_alphanumeric(data):
convert = lambda text: int(text) if text.isdigit() else text.lower()
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
return sorted(data, key=alphanum_key)
cwd = os.path.dirname(os.path.realpath(__file__))
os.chdir(cwd)
@codewings
codewings / CreatePivotFromSelection.cs
Created October 17, 2019 09:59
Create a pivot from selected GameObjects in unity
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
public class CreatePivotFromSelection
{
static void CreatePivot(Vector3 offset)
{
if (Selection.gameObjects == null || Selection.gameObjects.Length <= 0)
@codewings
codewings / __init__.py
Last active August 16, 2023 07:18
Intel GPA plugin used for asset dumping
import json
import os
import plugin_api
#
def IsUsefulInput(viewtype):
return viewtype == "CBV" or viewtype == "IBV" or viewtype == "VBV" or viewtype == "SRV"
def DumpBufferByDrawcall(folder, call, res, id, texture):
if not os.path.exists(folder):
@codewings
codewings / DrawBones.cs
Last active May 24, 2024 02:15
Display bones in Unity Editor
using UnityEngine;
[ExecuteInEditMode]
public class DrawBones : MonoBehaviour
{
#if UNITY_EDITOR
public bool ShowHierarchyAlwyas = true;
public bool ShowSelectedBoneName = true;
public Color BoneColor = Color.white;
public Color SelectedBoneColor = Color.red;
using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
namespace P4
{
class P4OutputStream : IDisposable
{
public StreamReader Reader { get; set; }
@codewings
codewings / ScreenDoorTransparency.hlsl
Created June 27, 2019 07:48
Snippet of screen door transparency with hand-written pattern
// https://en.wikipedia.org/wiki/Ordered_dithering
half threshold4x4[16] = {
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
};
half threshold8x8[64] = {
1.0 / 65.0, 49.0 / 65.0, 13.0 / 65.0, 61.0 / 65.0, 4.0 / 65.0, 52.0 / 65.0, 16.0 / 65.0, 64.0 / 65.0,
@codewings
codewings / UnityLightmapAssist.cs
Last active February 1, 2023 08:17
Simple editor window for checking lightmap in unity
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class LightmapAssist : EditorWindow
{
[MenuItem("Window/Lighting/Lightmap Assistant")]
public static void ShowLightmapAssistWnd()
# porting from https:#github.com/google/spherical-harmonics for blender [WIP]
import math, mathutils
from random import random, uniform
PI = math.pi
TWO_PI = 2.0 * PI
FACTORIAL_CACHE = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000]
DOUBLE_FACTORIAL_CACHE = [1, 1, 2, 3, 8, 15, 48, 105, 384, 945, 3840, 10395, 46080, 135135, 645120, 2027025]
FACTORIAL_CACHESIZE = 16