Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
✅
‏‏‎

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / BitmapExtensions.cs
Created August 24, 2020 14:10 — forked from nuitsjp/BitmapExtensions.cs
Convert System.Drawing.Bitmap to System.Windows.Media.ImageSource
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject([In] IntPtr hObject);
public static ImageSource ToImageSource(this Bitmap bmp)
{
var handle = bmp.GetHbitmap();
try
{
return Imaging.CreateBitmapSourceFromHBitmap(handle, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
@unitycoder
unitycoder / oldies.md
Last active August 19, 2020 10:42
Oldies Music Playlist

Playlist (still collecting)

unordered list

@unitycoder
unitycoder / Premiere Pro.md
Last active March 25, 2024 12:59
Premiere Pro

remove background

  • ultra key, for single color bg
  • use after effects rotoscope

make effects with reactive audio

  • cannot make in premiere pro, need to use after effects and link audio to expressions

Move to end of current track

  • shift-end/home but doesnt really work for current track
  • shift up/down jumps better on all clips
@unitycoder
unitycoder / radio.txt
Created August 17, 2020 07:02
Radio Notes
https://www.radioddity.com/products/baofeng-gt-3tp-mark-iii-two-way-radio
someone recommends https://twitter.com/jimhejl/status/1295252150931656705
@unitycoder
unitycoder / UnityPackage not importing to active unity
Last active April 3, 2023 09:40
Fix .UnityPackage for Opening into Currently Running Editor (instead of opening new Unity Instance)
- If you installed 32bit unity, and then removed it, it doesnt work
- install 5.6 64 bit to fix
or use registry fix below, IMPORTANT, insert some unity editor path there
@unitycoder
unitycoder / java-vs-csharp.md
Last active August 9, 2020 15:31
Java vs C#

https://forum.unity.com/threads/can-i-use-java.948277/#post-6185098

  • C# doesn't have or need primitive type wrappers like Integer and Boolean. A List in C# is not only possible, but the backing array will actually be an int[] without boxing.
  • C# has Classes which behave a lot like Java classes, but it also has structs, which do not. Structs act more like primitive types in Java: they are pass-by-value and you can use them without calling a constructor.
  • Primitive types (called simple types in C#) are full fledged objects, meaning you can call methods on them. For example this is valid: string s = 2.ToString();
  • Maps are called Dictionaries!
  • Interfaces use a kind of "Hungarian notation" by convention, where "I" is prepended to the interface name. For example: ICollection or IList.
  • TitleCase is the convention used for methods and properties instead of camelCase.
  • C# has a fleshed out property system. No more Getters/Setters
  • C#'s inheritance rules are a little different. In order to extend
@unitycoder
unitycoder / WaitForSecondsCached.cs
Created August 3, 2020 05:33
WaitForSeconds Cached
// https://forum.unity.com/threads/c-coroutine-waitforseconds-garbage-collection-tip.224878/page-2#post-6160273
//some magic with Templates to avoid allocations
//yield return Temp.WaitForSeconds(1);
//yield return Temp.WaitForSecondsRealtime(1);
public partial class WaitForSecondsCached
{
public static WaitForSecondsRealtime WaitForSecondsRealtime(float interval)
{
return Cache(arg => new WaitForSecondsRealtime(arg), interval);
@unitycoder
unitycoder / Garmin eTrex10.md
Created July 28, 2020 14:11
Garmin eTrex10

MapInstall

Cannot use: "No unlocked maps were found for this device"

@unitycoder
unitycoder / iphone5 vs iphone SE (2020).md
Last active October 13, 2020 19:06
iphone5 vs iphone SE (2020)

This is comparison for original iphone5 and new iphoneSE (2020), which i had hoped to be good replacement for deprecated iphone5 (which so far, in past 8 or so years, has been really durable and good phone, only had to replace battery 2 years ago for the first time!)

iphone SE (2020)

PROS

  • can run 64bit apps (which is annoying requirement to kill off older phones, in the hopes of forcing users to upgrade)

CONS

  • screen : has more friction, need to use more force to slide around
  • screen : not as durable compared to iphone5 gorilla glass, apple support avoided commenting anything (which means they know its worse quality, otherwise they would have advertized it as 2.5x more durable blah blah) https://twitter.com/unitycoder_com/status/1279493919307431937
@unitycoder
unitycoder / asus-rog-monitor.txt
Created July 11, 2020 16:16
Asus ROG Swift PG278QR Monitor Vertical Line Glitch Issue (144hz)
Monitor glitch
- 29.05.19 : after starting pc
- 15.06.19 : after starting pc
- 24.06.19 : after screenlock
- 27.07.19 : mouse cursor break glitch, in firefox usually
- 30.07.19 : after screen sleep
- 30.07.19 : mouse cursor break glitch, visual studio, after monitor sleep
(using 120hz)
- 02.08.19 : mouse cursor break glitch, thunderbird
- 16.08.19 : mouse cursor break glitch, firefox, after monitor sleep