Skip to content

Instantly share code, notes, and snippets.

Avatar

Vitaliy Zasadnyy zasadnyy

View GitHub Profile
@zasadnyy
zasadnyy / git-delete-not-tracked-branches.sh
Created Aug 25, 2017
Delete all git branches that are gone from origin
View git-delete-not-tracked-branches.sh
#!/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 Aug 14, 2017 — forked from bxt/git-deletebranches.sh
Git Delete Merged Branches
View git-deletebranches.sh
#!/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 Mar 8, 2016
Check method count for all jars in folder
View check-method-count.sh
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 Nov 23, 2018
Print all files and folders added to java classpath
View print class path
// 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());
}
View Unity application paths with different settings
============== 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 Jun 3, 2016
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
View EditorStateWindow.cs
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 Feb 9, 2014
.gitignore used by Unity teams at Nravo
View .gitignore
# =============== #
# Unity generated #
# =============== #
Temp/
obj/
Library/
# ===================================== #
# Visual Studio / MonoDevelop generated #
# ===================================== #
@zasadnyy
zasadnyy / DebugConsole.cs
Last active Dec 19, 2015 — forked from darktable/DebugConsole.cs
Now console fills whole available height. Added proper UI scaling for Android devices
View DebugConsole.cs
#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)
You can’t perform that action at this time.