Skip to content

Instantly share code, notes, and snippets.

@Kishanjvaghela
Kishanjvaghela / First.sol
Created September 3, 2018 17:55
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.24;
contract First {
function add(uint256 a ,uint256 b) view returns(uint256) {
return a + b;
}
}
@Kishanjvaghela
Kishanjvaghela / network_security_config.xml
Created May 8, 2018 21:11
making charles debugging work on marshmallo and above
+ android:networkSecurityConfig="@xml/network_security_config">
@Kishanjvaghela
Kishanjvaghela / ubuntu-eol.md
Created January 21, 2018 18:56 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@Kishanjvaghela
Kishanjvaghela / opacity.txt
Created December 8, 2017 09:00 — forked from alvinthen/opacity.txt
Convert opacity values in percentage to hexadecimal
0% - 00
1% - 03
2% - 05
3% - 08
4% - 0A
5% - 0D
6% - 0F
7% - 12
8% - 14
9% - 17
@Kishanjvaghela
Kishanjvaghela / AutoLink.js
Last active November 29, 2017 10:06
React Native Code
@Kishanjvaghela
Kishanjvaghela / ExamplePeopleAdapter.java
Last active January 14, 2021 03:02
Custom Filterable FirebaseRecyclerAdapter
import android.databinding.DataBindingUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.app.wanna.android.R;
import com.app.wanna.android.data.User;
import com.app.wanna.android.databinding.LayoutItemPeopleBinding;
import com.app.wanna.android.utils.firebaseadapter.FirebaseRecyclerAdapter;
@Kishanjvaghela
Kishanjvaghela / converter.sh
Last active November 17, 2022 11:26
Create Image drawable for all resolutions
if [ $# -eq 0 ]; then
echo "No arguments supplied"
else if [ -f "$1" ]; then
echo " Creating different dimensions (dips) of "$1" ..."
mkdir -p drawable-xxhdpi
mkdir -p drawable-xhdpi
mkdir -p drawable-hdpi
mkdir -p drawable-mdpi
if [ $1 = "ic_launcher.png" ]; then
package jp.likenote.android.utils;
import android.app.Activity;
import android.content.Context;
import android.media.AudioAttributes;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Build;
import android.util.Log;
HtmlImageGetter imageGetter = new HtmlImageGetter(getActivity(), R.drawable.image_html_response_background) {
@Override
public void onTextUpdate() {
CharSequence sequence = textView.getText();
textView.setText(sequence);
}
};
Spanned spanned;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
@Kishanjvaghela
Kishanjvaghela / gradle.md
Last active September 29, 2018 15:18 — forked from suwhs/gradle.md
5 steps for bintray-upload build.gradle (for jcenter)

add bintray and maven plugin to buildscript dependencies (project's build.gradle)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.2'
 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' // ADD THIS LINE