Skip to content

Instantly share code, notes, and snippets.

Avatar

Pascal Welsch passsy

View GitHub Profile
@passsy
passsy / BasicNetwork.java
Created Jul 8, 2013
BasicNetwork fix for Volley with fallback to Cache if the device is offline
View BasicNetwork.java
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View gist:6974427
live(british, red).
pet(swedish, dog).
drink(danish, tea).
nextto(green, white).
house(A, N) :- live(A, green), live(B, white), house(B, M), M < N.
left(green, white).
right(white, greem).
live(X, green) :- drink(X, coffee).
smoke(Z, pallmall) :- pet(Z, bird).
live(X, yellow) :- smoke(X, dunhill).
@passsy
passsy / gist:7748335
Last active Dec 30, 2015
LoaderManager.LoaderCallbacks<Cursor> methods with some boilerplate code for a quick CursorLoader start
View gist:7748335
@Override
public Loader<Cursor> onCreateLoader(final int id, final Bundle bundle) {
// Initialize the CurosorLoader
final int code = id - this.hashCode();
switch (code) {
case ID1:
String selection = null;
return new CursorLoader(getActivity(), CONTENT_URI, null,
selection, null, null);
View keybase.md

Keybase proof

I hereby claim:

  • I am passsy on github.
  • I am passsy (https://keybase.io/passsy) on keybase.
  • I have a public key whose fingerprint is F324 9507 7196 3722 893D F1F6 7172 7F0D 5DDC 5507

To claim this, I am signing this object:

@passsy
passsy / ArrayAdapter.java
Last active Apr 21, 2020
ArrayAdapter for RecyclerView
View ArrayAdapter.java
package com.pascalwelsch.utils;
import android.support.annotation.Nullable;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
View gist:40dd5533309b9fcdc1fa
adb shell setprop log.tag.Volley VERBOSE
@passsy
passsy / A_README.md
Last active Jan 17, 2020
Android Studio Light Theme
View A_README.md

Colorful Java (and Kotlin) Android Studio Theme

This Android Studio Theme (or IntelliJ in general) is based on many IDEs.

Previews

@passsy
passsy / material text sizes.md
Last active Jan 22, 2021
Material font sizes
View material text sizes.md
View gist:8e29670a3166ef4cb047
/**
* elevatorsaga level 10 - single queue
* http://play.elevatorsaga.com/#challenge=10
**/
{
init: function(elevators, floors) {
_.each(elevators, function(elevator) {
elevator.goToFloor(0);
});
@passsy
passsy / gist:9daebd806436ffb6dc02
Created Jan 27, 2015
elevatorsaga two queues
View gist:9daebd806436ffb6dc02
{
init: function(elevators, floors) {
_.each(elevators, function(elevator) {
elevator.goToFloor(0);
});
var upQueue = [];
var downQueue = [];