Skip to content

Instantly share code, notes, and snippets.

Avatar
🎡
Reinventing a better wheel

Massimo Artizzu MaxArt2501

🎡
Reinventing a better wheel
  • Italy
View GitHub Profile
@MaxArt2501
MaxArt2501 / share-this-skeleton.html
Last active Jun 23, 2017
share-this HTML skeleton
View share-this-skeleton.html
<div class="share-this-popover" style="position: absolute; ...">
<ul>
<li data-share-via="...">...</li>
...
</ul>
</div>
@MaxArt2501
MaxArt2501 / conic-gradient.svg
Created May 9, 2017
How to create a conic gradient in SVG (needs JavaScript)
View conic-gradient.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MaxArt2501
MaxArt2501 / ie-domtokenlist-toggle.js
Last active Feb 16, 2018
Add second argument support in DOMTokeList.toggle (e.g. for Internet Explorer)
View ie-domtokenlist-toggle.js
(function(dtl) {
if (!dtl) return;
var elem = document.createElement("div");
div.classList.toggle("test", false);
if (div.className === "test")
dtl.prototype.toggle = (function(toggle) {
return function(cls, force) {
if (typeof force === "boolean")
return this[force ? "add" : "remove"](cls);
@MaxArt2501
MaxArt2501 / _cmyk.scss
Last active Aug 31, 2020
CMYK helper functions for SASS
View _cmyk.scss
@function cmyk_black($color) {
@return 1 - max(red($color), green($color), blue($color)) / 255;
}
@function cmyk_cyan($color) {
$black: cmyk_black($color);
@return if($black < 1, 1 - red($color) / 255 / (1 - $black), 0);
}
@function cmyk_magenta($color) {
$black: cmyk_black($color);
@MaxArt2501
MaxArt2501 / codepointat.js
Last active Jul 16, 2016
A polyfill for `String.prototype.codePointAt`
View codepointat.js
String.prototype.codePointAt || (String.prototype.codePointAt = function(index) {
var code = this.charCodeAt(index);
if (code >= 0xd800 && code <= 0xdbff) {
var surr = this.charCodeAt(index + 1);
if (surr >= 0xdc00 && surr <= 0xdfff)
code = 0x10000 + ((code - 0xd800) << 10) + (surr - 0xdc00);
}
return code;
});
You can’t perform that action at this time.