Skip to content

Instantly share code, notes, and snippets.

Preact, Without Build Tools

This is a demonstration of using Preact without any build tooling. The library is linked from the esm.sh CDN, however a standalone JS file exporting HTM + Preact + Hooks can also be downloaded here.

import urllib2
import json
import sys
import os
from Tkinter import Tk
URL="https://api.github.com/gists"
TOKEN=""

Goal: find a Linux alternative to FancyZones for Windows

Name Recommended Type Supports main colum Supports layouts Multiple windows in same tile Notes
gSnap 👍 Gnome extension yes yes yes Can be configured almost just like FancyZones; in the settings:
  • disable Show tabs
  • enable Hold CTRL to snap windows
gTile Gnome extension no?
Tiling Assistant 🤷 Gnome extension yes yes yes Layout support is "experimental" and the UX is a bit unintuitive; after enabling layouts, you have to click the star icon beside a layout to mark it as a favourite before you can then hold Alt while dragging to snap to a tile
[Forge](https://extensions.gnome.o
import {LitElement, html, css} from 'https://unpkg.com/lit-element/lit-element.js?module';
class MyElement extends LitElement {
static get properties() {
return {
title: {
type: String
},
location: {
type: String
//defining autonomous custom elements:
if(!customElements.get('my-element')){
customElements.define('my-element',MyElement);
}
//defining customised button element:
if(!customElements.get('custom-button')){
customElements.define('custom-button',CustomButton,{extends:'button'})
}
@martinandersen3d
martinandersen3d / hello.js
Created January 15, 2023 22:36 — forked from UpperCod/hello.js
atomico-example
import { c, html } from "atomico"; // 3.0kB
function component({ name }) {
return html`<host shadowDom>Hello, ${name}</host>`;
}
component.props = {
name: String,
};
@martinandersen3d
martinandersen3d / bootstrap-all-elements.html
Created January 9, 2023 20:46 — forked from letanure/bootstrap-all-elements.html
List of all bootstrap components
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap all elements</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@martinandersen3d
martinandersen3d / DownloadAndShowImages.dib
Created November 21, 2022 22:48 — forked from AlRado/DownloadAndShowImages.dib
Downloads and displays images from the WEB
#!csharp
using System.Collections.Generic;
using System.Linq;
using Microsoft.DotNet.Interactive;
using Microsoft.DotNet.Interactive.Formatting;
using static Microsoft.DotNet.Interactive.Formatting.PocketViewTags;
void downloadAndShowImages(params string[] urls) {
display(span(urls.Select(url =>
@martinandersen3d
martinandersen3d / 00-Using_SQLite.dib
Created November 21, 2022 22:47 — forked from fravelgue/00-Using_SQLite.dib
Interactive (Polyglot) Notebook using SQLite
#!markdown
# Using SQLite in Notebook
Install ExtensionLab NuGet package
#!csharp
#r "nuget: System.Data.SQLite, *-*"
#r "nuget: Microsoft.DotNet.Interactive.ExtensionLab, *-*"
#!markdown
Records in C#
#!csharp
public class Course
{
public string Name {get; set;}
public string Author {get; set;}