Skip to content

Instantly share code, notes, and snippets.

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

Sagar Atalatti sagaratalatti

🏠
Working from home
  • India
View GitHub Profile
@sagaratalatti
sagaratalatti / Address.sol
Created May 13, 2021 13:22
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
pragma solidity ^0.6.12;
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}

Keybase proof

I hereby claim:

  • I am sagaratalatti on github.
  • I am ibitcoinist (https://keybase.io/ibitcoinist) on keybase.
  • I have a public key ASBjsyJfcpPl9aBGsD6FgvXBBKPhyqLxJnez2kjhJi6FBwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am sagaratalatti on github.
  • I am ibitcoinist (https://keybase.io/ibitcoinist) on keybase.
  • I have a public key ASBjsyJfcpPl9aBGsD6FgvXBBKPhyqLxJnez2kjhJi6FBwo

To claim this, I am signing this object:

@sagaratalatti
sagaratalatti / Readme.md
Created March 26, 2017 08:23 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@sagaratalatti
sagaratalatti / AndroidManifest.xml
Created January 26, 2017 16:54 — forked from daichan4649/AndroidManifest.xml
show Fragment on LockScreen (for Android)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="daichan4649.lockoverlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
@sagaratalatti
sagaratalatti / FirebaseRecyclerAdapter.java
Created January 17, 2017 14:51
Firebase GeoFire Android RecyclerView
public abstract class FirebaseRecyclerAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH > implements Filterable {
private static final String LOG_TAG = FirebaseRecyclerAdapter.class.getSimpleName();
private Query mRef;
private Class<T> mModelClass;
private int mLayout;
private LayoutInflater mInflater;
protected Class<VH> mViewHolderClass;
private List<T> mModels;
private List<T> mFilteredModels;