Skip to content

Instantly share code, notes, and snippets.

View wiztensai's full-sized avatar
💭
no system is safe

wiztensai

💭
no system is safe
View GitHub Profile
@johnwatsondev
johnwatsondev / DividerItemDecoration.java
Last active November 30, 2022 07:48
Customizing the DividerItemDecoration class so we can remove divider / decorator after the last item
/*
* Copyright (C) 2016 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
@abdullahbutt
abdullahbutt / gist:10253010
Created April 9, 2014 10:37
get last word from url after a slash in php
get last word from url after a slash in php
preg_match("/[^\/]+$/", "http://www.mydomainname.com/m/groups/view/test", $matches);
$last_word = $matches[0]; // test
OR
Use basename with parse_url:
echo basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
@cblunt
cblunt / MaskedImageView.java
Created July 25, 2012 11:22
Android MaskedImageView - Uses the Background resource as a mask for the src bitmap. If set, foregroundBitmap is overlaid on top of the masked image.
package com.example;
import android.content.Context;
import android.graphics.*;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.ImageView;