This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var USER = "USER" | |
var json = document.getElementById("taskboard").innerHTML.split("</script>"); | |
var data = JSON.parse(json[0].substring(55, json[0].length)) | |
function contains(list, item){ | |
var has = false | |
list.forEach(function(l){ | |
if (l == item){ | |
has = true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys,json,os, collections | |
infile = 'res.json' | |
def __main__(): | |
if (len(sys.argv) < 3): | |
print "Usage: \npython gen.py [android | ios] outfile" | |
sys.exit() | |
type = sys.argv[1] | |
if (type != "android" and type != "ios" ): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Each presenter must implement this interface | |
* | |
* @param <V> View for the presenter | |
</V> */ | |
interface BaseMvpPresenter<V : BaseView> { | |
/** | |
* @return true if view is attached to presenter | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KeyboardSensitiveRelativeLayout extends RelativeLayout { | |
private OnKeyboardShowHideListener listener; | |
public KeyboardSensitiveRelativeLayout(Context context) { | |
super(context); | |
} | |
public KeyboardSensitiveRelativeLayout(Context context, AttributeSet attrs) { | |
super(context, attrs); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyRecyclerViewAdapter(private val list: List<MyModel>) : RecyclerView.Adapter<MyRecyclerViewAdapter.ViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
val view = LayoutInflater.from(parent.context).inflate(R.layout.row_recycler, parent, false) | |
return ViewHolder(view) | |
} | |
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | |
val myModel = list[position] | |
holder.title.text = myModel.title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.net.SSLCertificateSocketFactory; | |
import android.os.AsyncTask; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.IOException; | |
import java.io.InputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void sendRequest() { | |
requestQueue = Volley.newRequestQueue(this, new HurlStack(null, pinnedSSLSocketFactory())); | |
StringRequest request = new StringRequest(Request.Method.GET, SECURE_URL, new Response.Listener<String>() { | |
@Override | |
public void onResponse(String response) { | |
Toast.makeText(MainActivity.this, "Response: " + response, Toast.LENGTH_SHORT).show(); | |
} | |
}, new Response.ErrorListener() { | |
@Override | |
public void onErrorResponse(VolleyError error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class PubKeyManager implements X509TrustManager { | |
private String publicKey; | |
public PubKeyManager(String publicKey) { | |
this.publicKey = publicKey; | |
} | |
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { | |
if (chain == null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
// .... | |
applicationVariants.all { variant -> | |
renameApk(variant, defaultConfig) | |
} | |
} | |
// --------------------------- | |
def renameApk(variant, defaultConfig) { |