Skip to content

Instantly share code, notes, and snippets.

View KushtrimPacaj's full-sized avatar
:octocat:
Coding!

Kushtrim Pacaj KushtrimPacaj

:octocat:
Coding!
View GitHub Profile
@KushtrimPacaj
KushtrimPacaj / configs.txt
Last active September 2, 2020 11:40
GIT configurations
git config --global alias.latest "for-each-ref --sort=committerdate refs/remotes/origin --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ "
export WITH_DEXPREOPT=false
export DISABLE_DEXPREOPT=true
export DEX_PREOPT_DEFAULT=nostripping
function generateAospPatchScript(){
echo ". build/envsetup.sh > /dev/null" > applyPatches.sh
find . -type f -name "*.patch" | sort -n | xargs -I '{}' sh -c '\
dName=$(dirname {}) ; \
rName=$(realpath {}) ; \
fName=$(basename $rName); \
echo "\n\
cd $dName\n\
echo \"Entering directory: \$PWD\"\n\
@KushtrimPacaj
KushtrimPacaj / generate_patching_script_for_folder_structured_patches.sh
Last active July 24, 2019 09:53
Meta-script that generates a script to apply patches in bulk
#Generates script to apply patches from folder structure
#For example if you have the following structure:
# ~/patch/A/subA/*.patch , and patches which have subA as "patch root",
# meaning they should be applied like this: "cd subA ; patch -p1 < *.patch"
# then this script generates a script with commands that will do exactly then in bulk.
#
# Sample script output:
# echo "Entering directory: $PWD"
# echo "Applying 0001-Fix-in-handling-header-decode-errors.bulletin.patch"
# cd ./external/libmpeg2
@KushtrimPacaj
KushtrimPacaj / webrtc_add_camera_zoom_api.diff
Created December 10, 2018 14:16
Add Zoom to WebRTC Camera API
diff --git a/sdk/android/api/org/webrtc/Camera1Capturer.java b/sdk/android/api/org/webrtc/Camera1Capturer.java
index f178a3d5d3..992d4036cf 100644
--- a/sdk/android/api/org/webrtc/Camera1Capturer.java
+++ b/sdk/android/api/org/webrtc/Camera1Capturer.java
@@ -11,7 +11,8 @@
package org.webrtc;
import android.content.Context;
-import javax.annotation.Nullable;
+
@KushtrimPacaj
KushtrimPacaj / ExpandableLayout.java
Created November 11, 2015 07:59
Expanding animation.
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.Transformation;
@KushtrimPacaj
KushtrimPacaj / AesEncryptDecrypt.java
Last active May 31, 2024 01:21
AES encryption in Java, equivalent of Crypt ( Encrypter.php class ) on Laravel (PHP)
import android.util.Base64;
import android.util.Log;
import com.google.gson.Gson;
import org.apache.commons.codec.binary.Hex;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.Key;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.Mac;