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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
import sys | |
import os | |
from Tkinter import Tk | |
URL="https://api.github.com/gists" | |
TOKEN="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The steps are: | |
# 1. convert a gif to a base64 html image | |
# 2. copy HTML to clipboard | |
# 3. in MS Word, paste the html-gif | |
# Note: This does not work in Gmail, Google Docs and google products | |
import base64 | |
import win32clipboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from tkinter import ttk | |
class GridApp: | |
def __init__(self): | |
self.root = tk.Tk() | |
self.root.title("Grid Layout") | |
# Create the Text_Linenumber widget |
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:
|
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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'}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { c, html } from "atomico"; // 3.0kB | |
function component({ name }) { | |
return html`<host shadowDom>Hello, ${name}</host>`; | |
} | |
component.props = { | |
name: String, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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 => |
NewerOlder