Skip to content

Instantly share code, notes, and snippets.

Kamen Dimitrov kamend

View GitHub Profile
@positlabs
positlabs / convert-audio.sh
Last active May 6, 2020
FFMPEG audio conversion for Spark AR
View convert-audio.sh
#! /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
@richtr
richtr / orientationChange.js
Last active Aug 22, 2019
JavaScript shim of iOS's window.orientation + orientationchange events for other (typically mobile) browsers
View orientationChange.js
/*
* 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
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.
View gist:5230032
// 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
@danomatika
danomatika / check-for-src-pattern
Last active Apr 1, 2018
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
View check-for-src-pattern
#! /bin/bash
#
# simple script to check for a given string pattern in any
# .c, .h, .cpp, .cxx, .m, .mm, etc source files
#
# Dan Wilcox <danomatika@gmail.com> 2014, 2016
#
# file type extensions to check (if none given)
EXTS=( ".c" ".h" ".cpp" ".hpp" ".cxx" ".m" ".mm" ".sh" ".pd" ".tcl" )
@NickDiMucci
NickDiMucci / RaycastCollisionDetection.cs
Created Nov 18, 2014
Raycast collision detection in Unity from a box collider, with diagonal raycasts from the corners to guard against corner collisions.
View RaycastCollisionDetection.cs
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;
You can’t perform that action at this time.