Skip to content

Instantly share code, notes, and snippets.

View zasadnyy's full-sized avatar

Vitaliy Zasadnyy zasadnyy

View GitHub Profile
@zasadnyy
zasadnyy / git-delete-not-tracked-branches.sh
Created August 25, 2017 10:48
Delete all git branches that are gone from origin
#!/bin/bash
#git fetch --prune # run fetch --prune to update local refs that were removed on orign
BRANCHES=$(git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}')
echo Branches that are gone on origin:
echo $BRANCHES | tr " " "\n"
read -p "Delete these branches (y/n)? " answer
@zasadnyy
zasadnyy / git-deletebranches.sh
Last active August 14, 2017 12:43 — forked from bxt/git-deletebranches.sh
Git Delete Merged Branches
#!/bin/bash
MAIN=develop
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|develop\|\*')
echo Branches merged into $MAIN:
echo $BRANCHES | tr " " "\n"
read -p "Delete these branches (y/n)? " answer
@zasadnyy
zasadnyy / check-method-count.sh
Created March 8, 2016 10:51
Check method count for all jars in folder
totalmethods=0
for jar in `find . -type f -name "*.jar"`; do
echo $jar
dx --dex --output=temp.dex $jar 2> /dev/null
jarmethods=$(cat temp.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"')
echo $jarmethods
totalmethods=$(($a+$totalmethods))
#echo $totalmethods
done
@zasadnyy
zasadnyy / print class path
Last active August 2, 2021 08:25
Print all files and folders added to java classpath
// JAVA
public static void main(String[] args)
{
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for(URL url: urls){
System.out.println(url.getFile());
}
============== Android with split application binary enabled
Application.dataPath: /storage/emulated/0/Android/obb/im.getsocial.testapp.unity/main.1.im.getsocial.testapp.unity.obb
Application.persistentDataPath: /storage/emulated/0/Android/data/im.getsocial.testapp.unity/files
Application.streamingAssetsPath: jar:file:///storage/emulated/0/Android/obb/im.getsocial.testapp.unity/main.1.im.getsocial.testapp.unity.obb!/assets
============== Android with split application binary DISabled
Application.dataPath: /data/app/im.getsocial.testapp.unity-2/base.apk
@zasadnyy
zasadnyy / EditorStateWindow.cs
Last active June 3, 2016 16:09
Small Unity 3D Editor Extension that shows current editor state (Editing/Compiling/Paused/Updating). In order to use this script, just put it in Editor folder. Screenshot: http://goo.gl/VJukpV
using System;
using UnityEditor;
using UnityEngine;
namespace Nravo.Editors.Utils {
public class EditorStateWindow : EditorWindow {
static string _currentState = "";
static GUIStyle _lableStyle = new GUIStyle();
@zasadnyy
zasadnyy / .gitignore
Created February 9, 2014 13:11
.gitignore used by Unity teams at Nravo
# =============== #
# Unity generated #
# =============== #
Temp/
obj/
Library/
# ===================================== #
# Visual Studio / MonoDevelop generated #
# ===================================== #
@zasadnyy
zasadnyy / DebugConsole.cs
Last active December 19, 2015 21:29 — forked from darktable/DebugConsole.cs
Now console fills whole available height. Added proper UI scaling for Android devices
#define DEBUG_CONSOLE
#define DEBUG_LEVEL_LOG
#define DEBUG_LEVEL_WARN
#define DEBUG_LEVEL_ERROR
#if (UNITY_EDITOR || DEVELOPMENT_BUILD)
#define DEBUG
#endif
#if (UNITY_IOS || UNITY_ANDROID)