Skip to content

Instantly share code, notes, and snippets.

☠️
I'm developing ...

abbas naqdi oky2abbas

☠️
I'm developing ...
Block or report user

Report or block oky2abbas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@oky2abbas
oky2abbas / high_quality_media_recorder.kt
Last active Oct 28, 2018
The MediaRecorder formula is compatible with various Android versions and high-quality audio recorder, Tested on Android 21 to 28
View high_quality_media_recorder.kt
// The MediaRecorder formula is compatible with various Android versions and high-quality audio recorder,
// Tested on Android 21 to 28
mediaRecorder = MediaRecorder().apply {
setAudioSource(MediaRecorder.AudioSource.MIC)
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
setAudioEncoder(MediaRecorder.AudioEncoder.HE_AAC)
setOutputFile(filePath)
setAudioEncodingBitRate(320000)
@oky2abbas
oky2abbas / proto_compile_command
Created Jul 10, 2018
proto file compile command
View proto_compile_command
protoc --go_out=plugins=grpc:. path/name.proto
@oky2abbas
oky2abbas / signature_check
Created Jul 6, 2018
signature apk check in runtime
View signature_check
PackageInfo info = null;
try {
info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
if (!Base64.encodeToString(md.digest(), Base64.DEFAULT).equals("sha sign key")) {
@oky2abbas
oky2abbas / git_ignore_force_history
Last active Jul 6, 2018
git ignore force for all history
View git_ignore_force_history
//use this comment in terminal in project directory
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' \
--prune-empty --tag-name-filter cat -- --all
git push origin --force --all
//or
You can’t perform that action at this time.