Skip to content

Instantly share code, notes, and snippets.

View kamend's full-sized avatar

Kamen Dimitrov kamend

View GitHub Profile
@kamend
kamend / bootable-win-on-mac.md
Created April 2, 2025 11:45 — forked from acarril/bootable-win-on-mac.md
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@kamend
kamend / gist:7cd39690ba0f90c4da29ecf60fcc05a3
Last active January 20, 2025 15:13
Upload image to Replicate through Unity and C#
[Serializable]
public class ReplicateImageUploadResponse
{
public string id;
public ReplicateImageUploadUrlsResponse urls;
}
[Serializable]
public class ReplicateImageUploadUrlsResponse
@kamend
kamend / SignAndPackageForMAS.sh
Created August 16, 2024 05:27 — forked from felix-schwarz/SignAndPackageForMAS.sh
Codesign an app bundle and build a signed package ready for submission to the Mac App Store
#!/bin/bash
#
# SignAndPackageForMAS.sh v1.0.1
#
# Codesign an app bundle and build a signed package ready for submission to the
# Mac App Store
#
# Copyright (c) 2014 Felix Schwarz (@felix_schwarz), IOSPIRIT GmbH (@iospirit)
#
@kamend
kamend / InstancedLines.cs
Created December 25, 2023 18:42
Port of Three Js Fat Lines with Unity instancing shader
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = System.Random;
public class InstancedLines : MonoBehaviour
{
struct LineInstanceData
@kamend
kamend / gist:ddf30de73ae17017d3b85c0f984cc0a1
Created August 9, 2023 07:57
Holding unstructured data in a Dictionary
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace DictExperiments
{
public static class DictExt
{
public class SceneObjectParser : IDisposable
@kamend
kamend / CustomPlacementInteractable.cs
Last active December 16, 2022 13:23
XR Interaction Toolkit: Custom ARPlacementInteractable to place object with the left mouse button when in the Editor
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit.AR;
public class CustomPlacementInteractable : ARPlacementInteractable
{
ARObjectPlacementEventArgs m_ObjectPlacementEventArgs = new ARObjectPlacementEventArgs();
void Update()
@kamend
kamend / convert-audio.sh
Created November 20, 2019 08:53 — forked from positlabs/spark-convert-audio.sh
FFMPEG audio conversion for Spark AR
#! /bin/bash
# This command converts audio according to the specifications listed in the Spark docs:
# https://sparkar.facebook.com/ar-studio/learn/documentation/docs/audio
# mono m4a, 44.1kHz sample rate, 16-bit-depth resolution
# Usage:
# convert-audio.sh myaudio.mp3 converted.m4a
# Notes:
# Always use m4a for output file type
# Change "64k" to a higher value to improve bitrate/quality. e.g. 96k 128k 192k
const D = require('Diagnostics');
const Scene = require('Scene');
const Patches = require('Patches');
const FaceTracking = require('FaceTracking');
const Shaders = require('Shaders');
const R = require('Reactive');
const Patchers = require('Patches');
const face = FaceTracking.face(0);
const rect = Scene.root.find("rectangle0");
const cam = Scene.root.find("Camera");
const Diagnostics = require('Diagnostics');
const Scene = require('Scene');
const Shaders = require('Shaders');
const Materials = require("Materials");
const R = require("Reactive");
const CameraInfo = require('CameraInfo');
const Textures = require('Textures');
const Time = require('Time');
const mat = Materials.get("material0");
const cameraTexture = Textures.get("cameraTexture0");
const Diagnostics = require('Diagnostics');
const Scene = require('Scene');
const Shaders = require('Shaders');
const Materials = require("Materials");
const R = require("Reactive");
const CameraInfo = require('CameraInfo');
const Textures = require('Textures');
const mat = Materials.get("material0");
const cameraTexture = Textures.get("cameraTexture0");