Skip to content

Instantly share code, notes, and snippets.

View starise's full-sized avatar
Damn fine coffee

Andrea Brandi starise

Damn fine coffee
View GitHub Profile
@starise
starise / Comparison - Todo Sizes.md
Created September 20, 2022 20:46 — forked from ryansolid/Comparison - Todo Sizes.md
Looking at how frameworks scale using their official TodoMVC Example and Vite

Based on Evan You's comparison which included Svelte and Vue. https://github.com/yyx990803/vue-svelte-size-analysis

For Preact, React, and Solid I took their official TodoMVC and ran them through Vite (2.3.6) to get vendor. For the components I grabbed the unminified source, ran it through Terser Repl, removed the imports, and ran through Brotli.

I wanted to use hooks for React and Preact since those are much smaller but all the official demos use classes. Adding Hooks adds library weight to Preact but it is worth it for this comparison(Preact with classes was 1.60kb and 3.81kb). Honestly I couldn't find a good hooks implementation for React/Preact that was small so I made one myself based on Solid.

Preact React Solid Svelte Vue
component size (brotli) 1.21kb 1.23kb 1.26kb 1.88kb 1.10kb
<!DOCTYPE html>
<html lang=X-LANG>
<meta charset=X-ENCODING>
<title>X-TITLE</title>
<link rel="stylesheet" href="X-STYLESHEET">
<p>X-CONTENT
@starise
starise / service.sh
Created February 15, 2021 15:50 — forked from n1trux/service.sh
arch linux service wrapper
#!/bin/sh
###########################################################################
# /usr/bin/service
#
# A convenient wrapper for the /etc/init.d init scripts.
#
# This script is a modified version of the /sbin/service utility found on
# Red Hat/Fedora systems (licensed GPLv2+).
#
@starise
starise / paperclips.js
Created October 17, 2017 13:03 — forked from brfreeman36/paperclips.js
Paperclips
var loop = setInterval(function(){
clipClick(1);
buyingWire();
letsQuantumCompute();
runTournament();
}, 2)
function buyingWire(){
//if (wireCost < wireBasePrice && wire < 1000000 || wire < 1){ // Not working well for early game
@starise
starise / windir.sh
Created September 24, 2017 11:42 — forked from Plazmaz/windir.sh
This is a simple function for converting windows paths (C:\Users\Test\t.txt) to their WSL equivalent (/mnt/c/Users/Test/t.txt)
# !/bin/bash
function windir() {
echo "/mnt/$1" | sed -e 's/\\\\/\//g' -e 's/\b\(.\):/\L\1/g'
}
@starise
starise / enable-bash.ps1
Created September 24, 2017 10:21 — forked from yuntsewu/enable-bash.ps1
On Windows 10, right click and press "Run with PowerShell" will install "Windows Subsystem for Linux" on your system. After it completes, Win+R -> bash will prompt you for the initialization.
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
}
# Add registry value to enable Developer Mode
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
@starise
starise / extras.php
Created November 2, 2015 19:19 — forked from E-VANCE/extras.php
JSON sitemap generation for use with UnCSS (+ Sage theme)
<?php
/**
* Generate JSON sitemap for use with UnCSS
*/
function show_sitemap() {
if (WP_ENV === 'development' && isset($_GET['show_sitemap'])) {
@starise
starise / md.php
Last active August 29, 2015 14:15 — forked from swalkinshaw/md.php
<?php
namespace Roots\Bedrock;
use League\CommonMark\CommonMarkConverter;
class MarkdownPosts {
const POST_OPTION = 'roots/bedrock/markdown_posts';
const IS_MD_META = 'roots/bedrock/is_markdown';
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Plugin Class Demo
* Description: How I am using the base class in plugins.
* Plugin URI:
* Version: 2012.09.29
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: GPL
* Text Domain: plugin_unique_name