Skip to content

Instantly share code, notes, and snippets.

View faruktoptas's full-sized avatar
🐝
I may be slow to respond.

Faruk Toptaş faruktoptas

🐝
I may be slow to respond.
View GitHub Profile
@faruktoptas
faruktoptas / bash
Created June 10, 2014 07:43
Useful bash commands
#find file
find . -name "*.*"
@faruktoptas
faruktoptas / .gitignore
Created February 3, 2016 08:33
Android .gitignore
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
@faruktoptas
faruktoptas / FaRequestManager.java
Created March 14, 2016 10:00
A simple class to make GET and POST requests.
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;
@faruktoptas
faruktoptas / gist:943a13767d92bf6648e0
Created June 10, 2014 07:40
Enable OS X App Store Debug mode
defaults write com.apple.appstore ShowDebugMenu -bool true
@faruktoptas
faruktoptas / aliases
Last active June 14, 2017 13:51
My bash_profile aliases
alias adbforw=./adb forward tcp:7777 tcp:7777
alias apkd=/.apktool d
alias apkb=/.apktool b
adb shell date $(date +%m%d%H%M%Y)
/**
* 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
*/
@faruktoptas
faruktoptas / MainActivity.java
Last active September 25, 2018 10:29
Public Key Pinning Run
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) {
@faruktoptas
faruktoptas / MyRecyclerViewAdapter.kt
Last active September 26, 2018 06:58
Simple RecyclerView Adapter
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
@faruktoptas
faruktoptas / objkeys.js
Last active January 4, 2019 10:19
JS Object Keys
function objkeys(obj){
keys = Object.keys(obj);
var ret = "";
for (var o in keys){
ret = ret +keys[o] + "=>" + obj[keys[o]] + "\n";
}
return ret;
}
@faruktoptas
faruktoptas / jcompile.sh
Created August 22, 2013 19:25
Sublime Text 2 Java compile build settings. Place jcompile.sh in /usr/bin directory then make it executable.
#!/bin/bash
file=$1
basename="${file%%.*}"
javac $file
java $basename