Skip to content

Instantly share code, notes, and snippets.

View Faydee1220's full-sized avatar

Faydee Faydee1220

View GitHub Profile
@mahmudahsan
mahmudahsan / ios_detect.swift
Last active July 9, 2021 09:07
iPhone X and other iOS device detection by Swift and Objective-C
struct Device {
// iDevice detection code
static let IS_IPAD = UIDevice.current.userInterfaceIdiom == .pad
static let IS_IPHONE = UIDevice.current.userInterfaceIdiom == .phone
static let IS_RETINA = UIScreen.main.scale >= 2.0
static let SCREEN_WIDTH = Int(UIScreen.main.bounds.size.width)
static let SCREEN_HEIGHT = Int(UIScreen.main.bounds.size.height)
static let SCREEN_MAX_LENGTH = Int( max(SCREEN_WIDTH, SCREEN_HEIGHT) )
static let SCREEN_MIN_LENGTH = Int( min(SCREEN_WIDTH, SCREEN_HEIGHT) )
@5SMNOONMS5
5SMNOONMS5 / 台灣身分證認證.swift
Last active February 13, 2023 02:42
台灣身分證認證 swift 5
//A 台北市 J 新竹縣
//B 台中市 K 苗栗縣 T 屏東縣
//C 基隆市 U 花蓮縣
//D 台南市 M 南投縣 V 台東縣
//E 高雄市 N 彰化縣 W 金門縣
//F 台北縣 O 新竹市 X 澎湖縣
//G 宜蘭縣 P 雲林縣
//H 桃園縣 Q 嘉義縣 Z 連江縣
//I 嘉義市
@fazlurr
fazlurr / BorderedCircleTransform.java
Last active February 18, 2021 22:29 — forked from berkkaraoglu/BorderedCircleTransform.java
Extend the Picasso transformation class to create bordered circle image with Picasso
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import com.squareup.picasso.Transformation;
public class CircleTransform implements Transformation {
private final int BORDER_COLOR = Color.WHITE;
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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