Skip to content

Instantly share code, notes, and snippets.

View itsmejkumar's full-sized avatar
🎯
Focusing

Jayakumar Venkatesan itsmejkumar

🎯
Focusing
View GitHub Profile
@gsanthosh91
gsanthosh91 / RecyclerAdapter.kt
Created June 18, 2018 05:41
Live template for Recyclerview Adapter in Kotlin
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
class ${NAME}(private val list: List<${LIST_MODEL}>) : RecyclerView.Adapter<${NAME}.CustomViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomViewHolder {
@krambertech
krambertech / Component.jsx
Created July 2, 2016 10:44
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@hartzis
hartzis / ImageUploadComponent.jsx
Last active April 3, 2023 18:09
React Image Upload with Preview
// https://codepen.io/hartzis/pen/VvNGZP
class ImageUpload extends Component {
constructor(props) {
super(props);
this.state = {
file: '',
imagePreviewUrl: ''
};
this._handleImageChange = this._handleImageChange.bind(this);
this._handleSubmit = this._handleSubmit.bind(this);
@marteinn
marteinn / volley-timeout.java
Created July 1, 2014 19:15
Android Volley Samples: Catching a timeout error.
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import org.json.JSONObject;
Response.Listener<JSONObject> successListener = new Response.Listener<JSONObject>() {