Skip to content

Instantly share code, notes, and snippets.

View RahulJanagouda's full-sized avatar
🚧

Rahul Janagouda RahulJanagouda

🚧
View GitHub Profile
@ficusk
ficusk / GsonRequest.java
Last active April 9, 2024 09:03
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@idosela
idosela / http-response-interceptor.js
Last active February 25, 2024 12:51
Sample code for ng-conf 2014
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
@maskaravivek
maskaravivek / Extract quotes from goodreads
Created March 28, 2014 15:24
This php code uses simple_html_dom to scrap quotes along with their authors from Goodreads to a MYSQL database.
<?php
include('config.php');
include('simple_html_dom.php');
if(!empty($_POST['name']) && !empty($_POST['number']))
{
$cat=$_POST['name'];
$no=$_POST['number'];
for($i=1;$i<$no;$i++)
{
$url="http://www.goodreads.com/quotes/tag/".$cat."?page=".$i;
@ssaunier
ssaunier / github_pages_repo.sh
Last active August 29, 2015 14:00
Quickly create a Github Pages repo
# What is your GitHub username? & your project name? Change with your own
GITHUB_USERNAME="ssaunier"
PROJECT_NAME="minesweep"
# We can create GitHub repo from the terminal, with https://github.com/github/hub
# It's really convinient. You can download it with:
brew install hub
# Say you want to work on a minesweep, create the repo:
mkdir -p ~/code/$GITHUB_USERNAME/$PROJECT_NAME && cd $_
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 28, 2024 15:27
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

public Bitmap blurBitmap(Bitmap bitmap){
//Let's create an empty bitmap with the same size of the bitmap we want to blur
Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
//Instantiate a new Renderscript
RenderScript rs = RenderScript.create(getApplicationContext());
//Create an Intrinsic Blur Script using the Renderscript
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
public class CircularProgressDrawable extends Drawable
implements Animatable {
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator();
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator();
private static final int ANGLE_ANIMATOR_DURATION = 2000;
private static final int SWEEP_ANIMATOR_DURATION = 600;
private static final int MIN_SWEEP_ANGLE = 30;
private final RectF fBounds = new RectF();
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing