Skip to content

Instantly share code, notes, and snippets.

View sanishkr's full-sized avatar
🍹
always high

Sanish sanishkr

🍹
always high
View GitHub Profile
@patrikengborg
patrikengborg / tailwind-rtl.js
Last active February 4, 2022 20:26
Function for Tailwind to add a custom variant plugin for RTL sites.
function ({ addVariant }) {
addVariant('rtl', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `[dir="rtl"] .rtl${separator}${className}`
})
})
}
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@perusio
perusio / gist:1326701
Created October 31, 2011 01:28
Mobile device detection in Nginx with just 7 lines of configuration
### Testing if the client is a mobile or a desktop.
### The selection is based on the usual UA strings for desktop browsers.
## Testing a user agent using a method that reverts the logic of the
## UA detection. Inspired by notnotmobile.appspot.com.
map $http_user_agent $is_desktop {
default 0;
~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule
~*spider|crawl|slurp|bot 1; # bots
~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes