Skip to content

Instantly share code, notes, and snippets.

View doggan's full-sized avatar

Shyam Guthikonda doggan

View GitHub Profile
@doggan
doggan / TestOverlayAudio.java
Created June 23, 2017 00:57
Use MediaMuxer to overlay a WAV onto an MP4
package com.test.mytest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.app.ProgressDialog;
import android.media.MediaCodec;
@doggan
doggan / CloudBundle.cs
Created June 16, 2017 19:56 — forked from chatpongs/CloudBundle.cs
Unity C# script to let Unity Cloud Build create bundles and upload them to some server
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using AssetBundles; // Require AssetBundleManager available here https://www.assetstore.unity3d.com/en/#!/content/45836
// Place this file in Editor filder
public class CloudBundle{
[PostProcessBuildAttribute(1)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {
@doggan
doggan / webglmem.js
Created May 2, 2017 23:26
Unity WebGL Memory Usage
// Ref: http://developers.kongregate.com/blog/unity-webgl-memory-and-performance-optimization
setInterval(function() {
if (typeof TOTAL_MEMORY !== 'undefined') {
try {
var totalMem = TOTAL_MEMORY/1024.0/1024.0;
var usedMem = (TOTAL_STACK + (STATICTOP - STATIC_BASE) +
(DYNAMICTOP - DYNAMIC_BASE))/1024.0/1024.0;
console.log('Memory stats - used: ' + Math.ceil(usedMem) + 'M' +
' free: ' + Math.floor(totalMem - usedMem) + 'M');
} catch(e) {}
@doggan
doggan / CloudBundle.cs
Created March 10, 2017 02:37 — forked from rcavallari/CloudBundle.cs
Unity C# script to let Unity Cloud Build create bundles and upload them to some server
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using AssetBundles; // Require AssetBundleManager available here https://www.assetstore.unity3d.com/en/#!/content/45836
// Place this file in Editor filder
public class CloudBundle{
[PostProcessBuildAttribute(1)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
- Parse the raw html dump from http://emojitracker.com, extracting a list of
the most frequently used emoji unicode points.
- Ideally, this script could parse the HTML directly, but since they use
AJAX to render the contents, it's easier to just copy the DOM (in chrome)
to a file and parse the file.
- Scrape/download the emojis from http://apps.timwhitlock.info/emoji/tables/unicode#emoji-modal
#!/usr/bin/env python
"""
Pre-processing of emoji images.
Requires ImageMagick (mogrify) to be installed and available via CLI.
"""
import argparse
import os
import subprocess
#!/usr/bin/env python
"""
Script to parse the most frequently used emoji unicode values from http://emojitracker.com.
"""
import argparse
from bs4 import BeautifulSoup
import glob
import os
@doggan
doggan / CloudBuildAPI.cs
Created February 16, 2016 22:47 — forked from joonjoonjoon/CloudBuildAPI.cs
set iOS build version to CloudBuild version
namespace UnityEngine.CloudBuild.API
{
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_CLOUD_BUILD
using UnityEditor;
@doggan
doggan / SavWav.cs
Created January 28, 2016 07:46 — forked from darktable/SavWav.cs
Unity3D: script to save an AudioClip as a .wav file.
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
#!/bin/sh
#
# Script for splitting a tileset image into multiple image files.
function show_usage() {
local ME=`basename "$0"`
echo "USAGE: $ME <in file> <output dir> --width <value> --height <value> {options}"
echo " "
echo "OPTIONS:"
echo " "