Skip to content

Instantly share code, notes, and snippets.

View thomasbergersen's full-sized avatar

ThomasBergersen thomasbergersen

View GitHub Profile
@rutcreate
rutcreate / README.md
Last active June 29, 2024 12:08
Install Python 3.10.x on Ubuntu 20.04

Prerequisite

sudo apt update
sudo apt install software-properties-common -y

Add custom APT repository

@nathzi1505
nathzi1505 / opencv-fonts.py
Created June 29, 2020 06:21
Custom OpenCV font
import cv2
import numpy as np
img = np.zeros((100, 300, 3), dtype=np.uint8)
ft = cv2.freetype.createFreeType2()
ft.loadFontData(fontFileName='Ubuntu-R.ttf',
id=0)
ft.putText(img=img,
text='Quick Fox',
@kou-yeung
kou-yeung / FileSystem.cs
Created May 8, 2020 06:36
Unity WebGL FileSystem Sync
using AOT;
using System;
using System.Collections.Generic;
namespace WebGL
{
public static class FileSystem
{
#if UNITY_WEBGL && !UNITY_EDITOR
[DllImport("__Internal")]
/// Singleton example
using UnityEngine;
public class SomeSingletonClass : MonoBehaviour
{
public static SomeSingletonClass instance;
void Awake() { instance = this; }
public float someValue;
@mickdekkers
mickdekkers / SnapshotCamera.cs
Last active May 14, 2024 11:26
Take snapshot images of Prefabs and GameObjects in Unity using Render Textures
using UnityEditor;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
// Object rendering code based on Dave Carlile's "Create a GameObject Image Using Render Textures" post
// Link: http://crappycoding.com/2014/12/create-gameobject-image-using-render-textures/