Skip to content

Instantly share code, notes, and snippets.

View kremilly's full-sized avatar
👋
Hello, World!

Kremilly kremilly

👋
Hello, World!
View GitHub Profile

cover

Header 1

Header 2

Header 3

Header 4

use regex::Regex;
pub struct Minify;
impl Minify {
pub fn js(code: &str) -> String {
let code = Regex::new(RegExp::MIN_JS_REMOVE_WHITESPACE).unwrap().replace_all(code, " ");
let code = Regex::new(RegExp::MIN_JS_REMOVE_SINGLE_LINE_COMMENT).unwrap().replace_all(&code, "");
let code = Regex::new(RegExp::MIN_JS_REMOVE_MULTI_LINE_COMMENT).unwrap().replace_all(&code.trim(), "");
[
"en",
"ceb",
"de",
"fr",
"sv",
"nl",
"ru",
"es",
"it",
mermaid.initialize({
theme: 'dark',
securityLevel: 'loose',
})
let mermaidCodeBlocks = document.querySelectorAll('.language-mermaid')
mermaidCodeBlocks.forEach( block => {
block.classList.remove('language-mermaid')
block.classList.add('diagram-mermaid')
@kremilly
kremilly / github-dark-md.css
Created May 7, 2024 02:01
GitHub markdown dark theme
@media(prefers-color-scheme:dark){.markdown-body,[data-theme=dark]{color-scheme:dark;--color-prettylights-syntax-comment: #8b949e;--color-prettylights-syntax-constant: #79c0ff;--color-prettylights-syntax-entity: #d2a8ff;--color-prettylights-syntax-storage-modifier-import: #c9d1d9;--color-prettylights-syntax-entity-tag: #7ee787;--color-prettylights-syntax-keyword: #ff7b72;--color-prettylights-syntax-string: #a5d6ff;--color-prettylights-syntax-variable: #ffa657;--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;--color-prettylights-syntax-invalid-illegal-bg: #8e1519;--color-prettylights-syntax-carriage-return-text: #f0f6fc;--color-prettylights-syntax-carriage-return-bg: #b62324;--color-prettylights-syntax-string-regexp: #7ee787;--color-prettylights-syntax-markup-list: #f2cc60;--color-prettylights-syntax-markup-heading: #1f6feb;--color-prettylights-syntax-markup-italic: #c9d1d9;--color-prettylights-syntax-markup-bold: #c9d1d9;--color-pretty
@kremilly
kremilly / wikipedia_stats.json
Created April 24, 2024 20:27
Wikipedia stats
[
{
"id": 1,
"language": "English",
"language_local": "English",
"wiki": "en",
"articles": "6,816,312",
"all_pages": "60,522,733",
"edits": "1,215,838,531",
"admins": 861,
{
"scripts": [
".js",
".ts",
".tsx",
".vue",
".min.js"
],
"styles": [
@kremilly
kremilly / sciscrape.yml
Last active March 29, 2024 10:23
SciScrape default settings
general:
force_https: false # Boolean
disable_cache: false # Boolean
format_date: '%Y-%m-%d' # String
calculate_request_time: true # Boolean
json_indent_size: 2 # Integer (unsigned)
default_user_agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36' # String
results:
auto_generate_bibtex: false # Boolean
fetch('https://gh-pinned-api.vercel.app/api?user=kremilly').then(
json => json.json()
).then(callback => {
console.log(callback)
})
@kremilly
kremilly / setup.py
Created November 16, 2023 16:40
setup.py pip
import os
import sys
from setuptools import find_packages, setup
def read(rel_path: str) -> str:
here = os.path.abspath(os.path.dirname(__file__))
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
with open(os.path.join(here, rel_path)) as fp: