Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Behrouz Khezry bkhezry

🏠
Working from home
Block or report user

Report or block bkhezry

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
@bkhezry
bkhezry / EncodingSRT.bash
Created Mar 16, 2019
Change encoding of subtitle to UTF-8 in the linux terminal
View EncodingSRT.bash
iconv -f CP1256 -t UTF-8 input.srt -o output.srt
View RequestToken.java
//Request google sign in
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
//Get selected account data
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
View GoogleSignInFunction.java
private void setUpGoogleSignIn() {
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
}
View logcat-shuffle.txt
1-28 13:02:11.695 4664-5179/? E/ImageLoader: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x67d71af8: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x5dc84d5c:0x00000000)
javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x67d71af8: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x5dc84d5c:0x00000000)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
at com.android.okhttp.Connection.connect(Connection.java:107)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(
View shuffle.html
<title>Shuffle</title>
<meta name="description" content="Shuffle is the easiest way to listen to the Persian music you love. Totally free.">
<script>!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id=GTM-NM4T2VK",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")</script><link href="/opensearch.xml" rel="search" title="shuffle" type="application/opensearchdescription+xml"><meta name="google" content="notranslate"><link href="/static/css/main.b9b045b9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NM4T2VK" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.21011b5d.js"></script></body><script async src=
@bkhezry
bkhezry / styles.xml
Created Jun 26, 2018
change NumberPicker theme
View styles.xml
<resources>
<style name="NumberPickerStyle" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColorPrimary">#000000</item>
</style>
</resources>
View PersianCalendar.java
/**
* Persian Calendar see: http://code.google.com/p/persian-calendar/
Copyright (C) 2012 Mortezaadi@gmail.com
PersianCalendar.java
Persian Calendar is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
View Sample.java
-----------------------------------com.example.Example.java-----------------------------------
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Example {
@SerializedName("user")
@bkhezry
bkhezry / README.md
Created Oct 2, 2016
upload image and additional parameter in android with Fast Android Networking Library to Web Service (asmx)
@bkhezry
bkhezry / proguard-rules.pro
Last active May 14, 2019
Proguard rules for popular libraries.
View proguard-rules.pro
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\bkhezry\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
You can’t perform that action at this time.