Skip to content

Instantly share code, notes, and snippets.

@Neoglyph
Neoglyph / rgb2cmyk.php
Last active November 17, 2023 21:57
Convert RGB to CMYK in PHP with Imagick
<?php
$iccProfile = '../path_to_icc/Profile.icc';
$image = new Imagick();
$image->clear();
$image->readImage($imagePath);
if ($image->getImageColorspace() == Imagick::COLORSPACE_CMYK) {
return;
}
$iccCmyk = file_get_contents($iccProfile);
@pascalduez
pascalduez / doNotTrack.md
Last active October 27, 2017 09:05
Do Not Track

Do Not Track

Implementations across browsers and JavaScript access.

Chrome

window.navigator.doNotTrack

setting: "Send a ‘Do Not Track’ request with your browsing traffic"
return: [ "1" or null ]

@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox
@krismas
krismas / argv.php
Last active August 3, 2019 16:37
A small MODX snippet to extract POST, GET, SESSION & COOKIE values
<?php
/*
* A small MODX snippet to extract POST, GET, SESSION & COOKIE values - (c) 2012-2016 ackwa.fr
*
* @version : 1.0.4
* @see : https://gist.github.com/gists/2853625
* @name : argv.php
* @author : g.noel@ackwa.fr
* @usage : [[!argv?key=`myparam`&default=`1`]] -> return the value
* [[!argv?key=`myparam`&default=`1`&toph=`1`]] -> set [[+argv.myparam]]
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}