Skip to content

Instantly share code, notes, and snippets.

View ishaan1995's full-sized avatar
🏠
Working from home

Ishaan Kakkar ishaan1995

🏠
Working from home
View GitHub Profile
02-12 12:58:19.263 7092-7092/com.ishaan.production.fileupload D/ishaan-parse: i/o failure
02-12 12:58:19.263 7092-7092/com.ishaan.production.fileupload W/System.err: com.parse.ParseRequest$ParseRequestException: i/o failure
02-12 12:58:19.273 7092-7092/com.ishaan.production.fileupload W/System.err: at com.parse.ParseRequest.newTemporaryException(ParseRequest.java:290)
02-12 12:58:19.273 7092-7092/com.ishaan.production.fileupload W/System.err: at com.parse.ParseRequest$2.then(ParseRequest.java:145)
02-12 12:58:19.273 7092-7092/com.ishaan.production.fileupload W/System.err: at com.parse.ParseRequest$2.then(ParseRequest.java:139)
02-12 12:58:19.273 7092-7092/com.ishaan.production.fileupload W/System.err: at bolts.Task$15.run(Task.java:917)
02-12 12:58:19.273 7092-7092/com.ishaan.production.fileupload W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
02-12 12:58:19.273 7092-7092/com.ishaan.production.fileupload W/System.err: at java.util.concu
final ParseFile file = new ParseFile(f);
file.saveInBackground(new SaveCallback() {
public void done(ParseException e) {
// Handle success or failure here ..
if (e == null) {
Toast.makeText(getApplicationContext(), "File Uploaded", Toast.LENGTH_SHORT).show();
Log.d("ishaan","uploadede url: "+file.getUrl());
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
.applicationId("myAppId")
.server("http://192.168.1.108:1337/parse/")
.build()
);
@ishaan1995
ishaan1995 / github_discussion_alert.py
Created November 30, 2018 09:45
Send Slack alert on new comment on discussion
import os
import json
from datetime import datetime, timedelta
import time
import requests
SLACK_URL = '<slack-hook-url-here>'
SLACK_ICON_URL = '<icon-url-for-message-here>'
SLACK_USERNAME = '<name-of-app-message-here>'
@ishaan1995
ishaan1995 / BlurrinessDetection.kt
Created May 28, 2020 00:42 — forked from ZacSweers/BlurrinessDetection.kt
Demo implementation of client-side image blurriness detection on Android using renderscript.
/*
* Copyright (c) 2018. Uber Technologies
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ishaan1995
ishaan1995 / animate_back_home_part.kt
Created February 17, 2021 08:29
Sample Android Blueprint Transition
fun animateForSearchClosedOnHome(onComplete: () -> Unit) {
val rootContent: View = rootView.findViewById(R.id.v_content)
val maxWidthTranslation = rootView.width.toFloat() / 4
val animator = ObjectAnimator.ofFloat(
rootContent,
View.TRANSLATION_X,
-1 * maxWidthTranslation,
0f
)
animator.duration = 500
@ishaan1995
ishaan1995 / animate_home_part.kt
Created February 17, 2021 08:31
Sample Android Blueprint Transition (Home Search Tap)
fun animateForSearchOpenOnHome(onComplete: () -> Unit) {
val rootContent: View = rootView.findViewById(R.id.v_content)
val maxWidthTranslation = rootView.width.toFloat() / 4
val animator = ObjectAnimator.ofFloat(
rootContent,
View.TRANSLATION_X,
0f,
-1 * maxWidthTranslation
)
animator.duration = 500
@ishaan1995
ishaan1995 / animate_search_part.kt
Created February 17, 2021 08:33
Sample Android Blueprint Transition (Home -> Search Opening)
fun animateForSearchOpening(onComplete: () -> Unit) {
val animator = rootView.findViewById<LinearLayout>(R.id.node_search).fadeInAnimator(
duration = 100L,
startDelay = 50L,
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f)
)
val searchContentAnimator = rootView.findViewById<LinearLayout>(R.id.ll_search_content).fadeInAnimator(
duration = 100L,
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f)
)
@ishaan1995
ishaan1995 / animate_back_search_part.kt
Created February 17, 2021 08:39
Sample Android Blueprint Transition (Search Screen Back Icon Tap)
fun animateForSearchClosing(onComplete: () -> Unit) {
val searchContentAnimator = rootView.findViewById<LinearLayout>(R.id.ll_search_content).fadeOutAnimator(
duration = 100L,
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f)
)
val searchToolbarAnimator = rootView.findViewById<Toolbar>(R.id.toolbar_search).fadeOutAnimator(
duration = 500,
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f)
@ishaan1995
ishaan1995 / animate_back_home_part.kt
Created February 17, 2021 08:43
Sample Android Blueprint Transition (Search -> Home Part)
fun animateForSearchClosedOnHome(onComplete: () -> Unit) {
val rootContent: View = rootView.findViewById(R.id.v_content)
val maxWidthTranslation = rootView.width.toFloat() / 4
val animator = ObjectAnimator.ofFloat(
rootContent,
View.TRANSLATION_X,
-1 * maxWidthTranslation,
0f
)
animator.duration = 500