Skip to content

Instantly share code, notes, and snippets.

View opatry's full-sized avatar
👋
Hi!

Olivier Patry opatry

👋
Hi!
View GitHub Profile
@glureau
glureau / ThemeColorPreview.kt
Last active September 13, 2021 10:41
Display
package com.glureau
import android.content.res.Configuration.UI_MODE_NIGHT_NO
import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.material.MaterialTheme
<?php
function gfm($text){
# Extract pre blocks
$extractions = array();
$text = preg_replace_callback('/<pre>.*?<\/pre>/s', function($matches) use (&$extractions){
$match = $matches[0];
$md5 = md5($match);
$extractions[$md5] = $match;
@juev
juev / related_articles_help.rb
Created June 29, 2011 11:33 — forked from owengriffin/related_articles_help.rb
Nanoc helper to list articles related to the current item