Skip to content

Instantly share code, notes, and snippets.

View koganas's full-sized avatar

Daniel Koganas koganas

View GitHub Profile
@koganas
koganas / blurhashDataURL.ts
Created March 15, 2024 08:03 — forked from mattiaz9/blurhashDataURL.ts
Convert blurhash to a base64 DataURL string (no canvas or node-canvas)
import { decode } from "blurhash"
export function blurHashToDataURL(hash: string | undefined): string | undefined {
if (!hash) return undefined
const pixels = decode(hash, 32, 32)
const dataURL = parsePixels(pixels, 32, 32)
return dataURL
}
{"version":1,"resource":"file:///Users/kog/Documents/projects/teneo/web/app/themes/teneo/static/src/sass/components/_pagination.scss","entries":[{"id":"O66U.scss","timestamp":1653553389077},{"id":"vDxd.scss","timestamp":1653553406852},{"id":"Notb.scss","timestamp":1653585111129}]}
date name category value
1960-01-01 Australia 18578000
1960-01-01 Brazil 15166000
1960-01-01 China 9 59716000
1960-01-01 France 62651000
1960-01-01 India 37030000
1960-01-01 Italy 40385000
1960-01-01 Japan 44307000
1960-01-01 Korea Rep. 3957000
1960-01-01 Mexico 13040000
@koganas
koganas / _grid.css
Last active August 17, 2020 16:05
Infinite column flexbox grid - Using PostCSS and postcss-for
/* Grid */
$totalColumns: 12;
$col: calc(100 / $totalColumns)%;
$space: 2rem;
.container {
max-width: $maxWidth;
margin: 0 auto;
position: relative;
display: flex;
@koganas
koganas / WP useful category functions
Last active October 29, 2019 18:02
Wordpress category functions using YOAST
function get_primary_category() {
$category = get_the_category();
$useCatLink = true;
/* if( in_array( 'wordpress-seo/wp-seo.php', apply_filters( 'active_plugins', get_option('active_plugins') ) ) ) */
if ($category) {
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') ) {
$wpseo_primary_term = new WPSEO_Primary_Term( 'category', get_the_id() );