Skip to content

Instantly share code, notes, and snippets.

View MaartenS's full-sized avatar

Maarten MaartenS

View GitHub Profile

A curated list of shell commands and tools specific to OS X.

“You don’t have to know everything. You simply need to know where to find it when necessary.” (John Brunner)

Awesome Gitter

For more terminal shell goodness, please also see this list's sister list Awesome Command Line Apps.

@MaartenS
MaartenS / Bottom sheet Android.md
Last active October 24, 2020 03:53
Android snippets #android

##Flipboard style bottom sheet in Android

gradle dependecies

compile 'com.flipboard:bottomsheet-core:1.5.0'
compile 'com.flipboard:bottomsheet-commons:1.5.0' // optional

In view wrap your layout using the BottomSheetLayout

@MaartenS
MaartenS / Android - material spinner.md
Last active February 20, 2019 13:29
example usage of the AppCompatSpinner
<android.support.design.widget.TextInputLayout
           android:layout_width="match_parent"
           android:layout_height="wrap_content">

    <android.support.v7.widget.AppCompatSpinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        bind:items="@{viewModel.spiinnerItems}" />
@MaartenS
MaartenS / creditcards.md
Last active November 13, 2017 16:28 — forked from j3j5/gist:8b3e48ccad746b90a54a
Adyen Test Card Numbers

Adyen Test Card Numbers These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.

For all cards use the following expiration and CVV2/CVC2/or CID for Amex.

For all cards:

Expiration Dates CVV2 / CVC3 CID (American Express) 06/2016 OR 08/2018 737 7373

When using pagers in Fragment you need to use getChildFragmentManager instead of getSupportFragmentManager(). Otherwise the page will not be redrawn when activity pauses.

float scale = getResources().getDisplayMetrics().density;
dpAsPixels = (int) (sizeInDp * scale + 0.5f);
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from pyquery import PyQuery as pq
import string

print '📽' # 🎥'

series = ['face_off', 'new_girl', 'big_bang_theory']
for serie in series:
git submodule update --init 
git submodule foreach 'git checkout version/api' 

composer install 
composer dumpautoload -o
public class MyActivity extends Activity{

    private Handler mHandler = new Handler();

}
Timer timer = new Timer();

Remove the background shade and dialog background from an Android Dialog

final Dialog dialog = new Dialog(context);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
        dialog.setContentView(R.layout.overlay_loading);
        dialog.setCancelable(false);
 dialog.show();