Skip to content

Instantly share code, notes, and snippets.

View mstfydmr's full-sized avatar
🚀
Focusing

Mustafa Aydemir mstfydmr

🚀
Focusing
View GitHub Profile
@mstfydmr
mstfydmr / TailwindCSS_CheatSheet.json
Created November 19, 2022 21:21
TailwindCSS JSON Cheat Sheet
[
{
"title": "Layout",
"content": [
{
"title": "Aspect Ratio",
"docs": "https://tailwindcss.com/docs/aspect-ratio",
"description": "Utilities for controlling the aspect ratio of an element.",
"table": [
["aspect-auto", "aspect-ratio: auto;", ""],
<?php
function addCanonicalTag($html, $url) {
$dom = new DOMDocument();
@$dom->loadHTML($html, LIBXML_HTML_NODEFDTD);
$head = $dom->getElementsByTagName('head')->item(0);
if ($head) {
$canonical = $dom->getElementsByTagName('link')->item(0);
@mstfydmr
mstfydmr / gist:44419d07cbfab7bbdde7a294a340d9be
Created August 1, 2023 12:39 — forked from jcsrb/gist:1081548
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version