Skip to content

Instantly share code, notes, and snippets.

View kaushalbhardwaj's full-sized avatar

Kaushal Pratap kaushalbhardwaj

View GitHub Profile
@AradiPatrik
AradiPatrik / activity_main.xml
Created December 27, 2020 09:27
The View gets pushed up by the RecyclerView but never out of screen
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
app:layoutDescription="@xml/motion_scene"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<View
android:id="@+id/header"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewserong
andrewserong / VideoPlayer.jsx
Created October 19, 2017 05:47
An example Video JS component in React, based on the Video JS docs
import React from 'react';
import videojs from 'video.js';
import 'video.js/dist/video-js.css';
// video.js player from the docs: https://github.com/videojs/video.js/blob/master/docs/guides/react.md
class VideoPlayer extends React.Component {
componentDidMount() {
// instantiate Video.js
this.player = videojs(this.videoNode, this.props, function onPlayerReady() {
@srayhunter
srayhunter / FetchContactsAsync.java
Last active April 26, 2024 20:22
Android - Get phone number and email address from Contacts
private class FetchContacts extends AsyncTask<Void, Void, ArrayList<Contact>> {
private final String DISPLAY_NAME = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY : ContactsContract.Contacts.DISPLAY_NAME;
private final String FILTER = DISPLAY_NAME + " NOT LIKE '%@%'";
private final String ORDER = String.format("%1$s COLLATE NOCASE", DISPLAY_NAME);
@SuppressLint("InlinedApi")
@lopspower
lopspower / README.md
Last active November 19, 2025 00:05
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@hector6872
hector6872 / LockableViewPager.java
Created March 3, 2016 16:15
LockableViewPager
public class LockableViewPager extends ViewPager {
private static final boolean DEFAULT_LOCK_STATE = false;
private boolean locked;
public LockableViewPager(Context context) {
this(context, null);
}
public LockableViewPager(Context context, AttributeSet attrs) {
@maheshwarLigade
maheshwarLigade / build.gradle
Created February 2, 2016 05:25 — forked from jackgris/build.gradle
Example of use from Proguard, from Android Studio
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
@srayhunter
srayhunter / android-adb-over-wifi.md
Last active June 22, 2022 16:41
Android ADB over Wifi

Android ADB over Wifi

Here is a simple way to use ADB over wifi with your device. Make sure that ADB can reach your device over the network.

  1. Connect device to usb

  2. Restart the ADB daemon to listening on TCP port

adb tcpip 5555

@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active February 24, 2025 17:33
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@jojobyte
jojobyte / ContextCmder-Disable.reg
Last active June 28, 2025 00:14
Cmder Context (Right-Click) Menu for Windows 7, 8, 10 & 11
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]