Skip to content

Instantly share code, notes, and snippets.

View therajanmaurya's full-sized avatar
🎯
Focusing

Rajan Maurya therajanmaurya

🎯
Focusing
View GitHub Profile
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@emil2k
emil2k / Connectivity.java
Last active December 22, 2023 06:03
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@bichotll
bichotll / load_disqus_comments_android.java
Last active April 25, 2019 15:19
Load disqus comments with a htmlview in Android
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_comments);
String htmlComments = getHtmlComment("yourId", "yourShortName");
webDisqus = (WebView) findViewById(R.id.disqus);
// set up disqus
WebSettings webSettings2 = webDisqus.getSettings();
@staltz
staltz / introrx.md
Last active May 30, 2024 18:43
The introduction to Reactive Programming you've been missing
@waynepiekarski
waynepiekarski / NotificationExamplesMainActivity
Last active July 16, 2018 08:34
Example of using stack and page notifications with the Android Wear SDK
package testing.blog.waynepie.blogtesting;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Intent;
@tsuharesu
tsuharesu / AddCookiesInterceptor.java
Last active April 11, 2024 12:37
Handle Cookies easily with Retrofit/OkHttp
/**
* This interceptor put all the Cookies in Preferences in the Request.
* Your implementation on how to get the Preferences MAY VARY.
* <p>
* Created by tsuharesu on 4/1/15.
*/
public class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
@Suleiman19
Suleiman19 / Spinner Setup (Activity)
Last active October 11, 2022 14:10
Theme Aware Material Design Spinner
Spinner spinner = (Spinner) findViewById(R.id.main_spinner);
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getSupportActionBar().getThemedContext(),
R.layout.spinner_list_style,
getResources().getStringArray(R.array.countries));
spinnerAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
spinner.setAdapter(spinnerAdapter);
@trajakovic
trajakovic / DeleteModelInBatchOnSubscribe.java
Created May 2, 2016 12:51
Android DbFlow Update/Delete/Save models in batch with RxJava - ReactiveX with DbFlow
import android.database.Cursor;
import android.support.annotation.NonNull;
import com.raizlabs.android.dbflow.runtime.DBTransactionInfo;
import com.raizlabs.android.dbflow.runtime.TransactionManager;
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction;
import com.raizlabs.android.dbflow.runtime.transaction.QueryTransaction;
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener;
import com.raizlabs.android.dbflow.sql.builder.ConditionQueryBuilder;
import com.raizlabs.android.dbflow.sql.language.Delete;
@jmfayard
jmfayard / Config.kt
Last active September 22, 2020 13:15
Gists Gradle-Kotlin-DSL
// buildSrc/src/main/kotlin/Config.kt
object Config {
const val ACTIVITY = "com.mautinoa.cardapp.MainActivity"
const val PACKAGE = "com.mautinoa.cardapp"
const val kotlinVersion = "1.2.71"
object SdkVersions {
val versionCode = 1
val compile = 28
val target = 26