Skip to content

Instantly share code, notes, and snippets.

View alannaidon's full-sized avatar

Alan Naidon alannaidon

View GitHub Profile
@mondaini
mondaini / Remote.md
Last active November 24, 2023 20:08
List of companies hiring for full remote positions to work with companies in the US/Europe
@basham
basham / css-units-best-practices.md
Last active April 29, 2024 10:40
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@NickBeeuwsaert
NickBeeuwsaert / json_pretty_encode.php
Last active October 27, 2021 14:08
PHP versions prior to 5.4 didn't have JSON_PRETTY_PRINT for json_encode, so here, I guess...
<?php
//PHP got the JSON_PRETTY_PRINT option for json_encode in 5.4, and I had to use a older version of PHP,
// So I made this
function json_pretty_encode($arr, $indent=" ", $characters=array(", ", ": "), $depth=0, $eol=PHP_EOL){
//You'd think that with the plethora of functions PHP has for array operations, they'd have one to check
// if an array is associative or not
// Now, I know what your saying "Oh, but, ALL arrays in PHP are associative!" Suck it, you know what I mean
$is_assoc = (array_keys($arr) !== range(0,count($arr)-1));
end($arr);