Skip to content

Instantly share code, notes, and snippets.

View alekslario's full-sized avatar
🎯
Focusing

Aleksandrs Larionovs alekslario

🎯
Focusing
View GitHub Profile
@alekslario
alekslario / gist:d4e4ddef4394680448ceabffe40c0c7a
Created August 21, 2020 01:07 — forked from robertkowalski/gist:4206422
adding meta tags to head with javascript
var meta=document.createElement('meta');
meta.name='viewport';
meta.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0');
document.getElementsByTagName('head')[0].appendChild(meta);
@alekslario
alekslario / NextServerlessCodebuildIamPolicy.json
Last active April 22, 2020 22:48 — forked from jimmdd/NextServerlessCodebuildIamPolicy.json
IAM permission sets for deploying next-serverless component in code build env
{
"Version": "2012-10-17",
"Statement":
[
{
"Action":
[
"cloudfront:CreateCloudFrontOriginAccessIdentity",
"cloudfront:CreateDistribution",
"cloudfront:UpdateDistribution",
@alekslario
alekslario / media-query.css
Created September 3, 2019 15:00 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@alekslario
alekslario / uuid.js
Created June 1, 2019 12:35 — forked from duzun/uuid.js
A simple UUID v4 generator, relying on Math.random() + Date.now()
/** Generates UUID v4
*
* @node There is a bug in Chrome's Math.random() according to http://devoluk.com/google-chrome-math-random-issue.html
* For that reason we use Date.now() as well.
*/
function UUID() {
function s(n) { return h((Math.random() * (1<<(n<<2)))^Date.now()).slice(-n); }
function h(n) { return (n|0).toString(16); }
return [
s(4) + s(4), s(4),