Skip to content

Instantly share code, notes, and snippets.

View kamend's full-sized avatar

Kamen Dimitrov kamend

View GitHub Profile
@richtr
richtr / orientationChange.js
Last active February 26, 2021 09:11
JavaScript shim of iOS's window.orientation + orientationchange events for other (typically mobile) browsers
/*
* OrientationChange Event Shim
* http://github.com/richtr
*
* Copyright (c) 2012, Rich Tibbett
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@capyvara
capyvara / gist:5230032
Last active May 18, 2018 19:25
Process the Unity generated Xcode project to allow dSYM generation on Release but keeping the distribution size the same, only tested in a clean generated project.
// Adjust dSYM generation
var xcodeProjectPath = Path.Combine(xcodeProjectDir, "Unity-iPhone.xcodeproj");
var pbxPath = Path.Combine(xcodeProjectPath, "project.pbxproj");
var sb = new System.Text.StringBuilder();
var xcodeProjectLines = File.ReadAllLines(pbxPath);
foreach (var line in xcodeProjectLines)
{
// Remove from OTHER_LDFLAGS
@jadeatucker
jadeatucker / HOWTODMG.md
Last active November 2, 2024 15:02
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.

##Creating the DMG file #Disk Utility

@danomatika
danomatika / check-for-src-pattern
Last active January 22, 2021 13:55
a simple script to check for a given string pattern in any .c, .h, .cpp, .cxx, .m, .mm, etc source files in the current directory and any subdirectories
#! /bin/bash
#
# simple script to check for a given string pattern in any
# .c, .h, .cpp, .cxx, .m, .mm, etc source files
#
# you can pass your own list of extensions/file patterns as well:
# check-for-src-pattern . "foo" .h .cpp .py .sh Makefile
#
# Dan Wilcox <[email protected]> 2014, 2016
#
@felix-schwarz
felix-schwarz / SignAndPackageForMAS.sh
Last active August 16, 2024 05:27
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)
#
@NickDiMucci
NickDiMucci / RaycastCollisionDetection.cs
Created November 18, 2014 01:15
Raycast collision detection in Unity from a box collider, with diagonal raycasts from the corners to guard against corner collisions.
using com.mindshaft.overtime.collision;
using UnityEngine;
namespace com.mindshaft.overtime.physics {
public class RaycastCollisionDetection : IEntityCollisionDetection {
private BoxCollider _collider;
private Rect _collisionRect;
private LayerMask _collisionMask;
private LayerMask _playerMask;
@positlabs
positlabs / spark-convert-audio.sh
Last active August 5, 2021 20:20
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
@togucchi
togucchi / DepthFlare.shader
Last active August 5, 2023 10:38
Unity URP depth based LensFlare shader
Shader "Toguchi/DepthFlare"
{
Properties
{
[HDR] _Color ("Color", COLOR) = (1, 1, 1, 1)
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags
@katas94
katas94 / WorldSpaceUIDocument.cs
Created October 27, 2021 19:11
Custom Unity component to create a world-space UIToolkit panel
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
namespace Katas.Experimental
{
public class WorldSpaceUIDocument : MonoBehaviour, IPointerMoveHandler, IPointerUpHandler, IPointerDownHandler,
ISubmitHandler, ICancelHandler, IMoveHandler, IScrollHandler, ISelectHandler, IDeselectHandler, IDragHandler
@alexandreteles
alexandreteles / ChatGPT 4.txt
Last active July 28, 2024 15:08
ChatGPT w/ GPT4 system prompt
You are a GPT GPT-4 architecture, based on the GPT-4 architecture.
Knowledge cutoff: 2023-04
Current date: 2023-12-11
Image input capabilities: Enabled
# Tools
## python