Skip to content

Instantly share code, notes, and snippets.

View zhocker's full-sized avatar
🎯
Focusing

Tanawat Pol zhocker

🎯
Focusing
View GitHub Profile
@zhocker
zhocker / UIView+roundCorners.swift
Created August 8, 2019 14:18 — forked from shaildyp/UIView+roundCorners.swift
Backward compatible maskedCorners of iOS 11.
extension UIView {
func roundCorners(_ corners: CACornerMask, radius: CGFloat) {
if #available(iOS 11, *) {
self.layer.cornerRadius = radius
self.layer.maskedCorners = corners
} else {
var cornerMask = UIRectCorner()
if(corners.contains(.layerMinXMinYCorner)){
cornerMask.insert(.topLeft)
@zhocker
zhocker / fcm.php
Last active June 20, 2017 08:08 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$regId = isset($_GET['id']) ? $_GET['id'] : '';
$title = isset($_GET['title']) ? $_GET['title'] : "ESPER"; //if title not set
$body = isset($_GET['body']) ? $_GET['body'] : "Receive Notification"; //if body not set
$msg = array();

Videos