Skip to content

Instantly share code, notes, and snippets.

@willurd
willurd / web-servers.md
Last active March 29, 2024 02:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bsquidwrd
bsquidwrd / fetch_emails.py
Created April 10, 2017 15:42
Fetch Emails with Python
import email
import imaplib
import os
SERVER = 'imap.gmail.com'
USERNAME = 'EMAIL ADDRESS'
PASSWORD = 'PASSWORD'
class FetchEmail():
@spencerwooo
spencerwooo / ttrss-theme.css
Last active March 29, 2024 02:12
Tiny Tiny RSS Pink-Feedly Theme
@import url(https://fonts.googleapis.com/css?family=Miriam+Libre:400,700&display=swap);
a.title {
font-family: 'Miriam Libre', Noto Sans CJK SC, Microsoft YaHei, sans-serif, Apple Color Emoji, Segoe UI Emoji!important
}
#content-wrap#content-wrap .content,
#content-wrap#content-wrap .content-inner,
#feedTree,
body {
font-family: Avenir Next, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, PingFang SC, Noto Sans CJK SC, Microsoft YaHei, sans-serif, Apple Color Emoji, Segoe UI Emoji!important

UX Notes:

General Visuals

  • The current state/value of a widget should be obvious/visible.
  • If the value doesn't fit the last digit should be faded to indicate that the value shown is only partial. A good heuristic would be to choose a size that is large enough to fit 3 digit numbers (e.g. selecting a value between 0-100)
  • Expand the label when the user is interacting with the widget.
  • The the widget's state/value should always be visible, move the location of the label if necessary (e.g. when pointer is interacting with the widget)
  • A widget should optionally provide an indication of the min/max boundaries, where relevant.
  • The slider should optionally provide an indication of intermediate values (e.g. axis ticks) between the min/max boundaries, where relevant.
  • UI elements that are used for fine control (e.g. knobs) should be big enough to make them easy to grab.
  • For widgets with a single functionality the entire widget's area should optionally be wired to trigger the widget's action.
@pobsuwan
pobsuwan / rabbitmq-cluster.md
Last active March 29, 2024 02:05
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 02:09
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@hibiyasleep
hibiyasleep / GodDrinksJava.java
Last active March 29, 2024 01:59
world.execute(me);
package goddrinksjava;
/**
* The program GodDrinksJava implements an application that
* creates an empty simulated world with no meaning or purpose.
*
* @author momocashew
* @lyrics hibiyasleep
*/
@a-natureza
a-natureza / git.md
Created March 29, 2024 01:55 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@leocomelli
leocomelli / git.md
Last active March 29, 2024 01:55
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@asamofal
asamofal / update_bions_lenovo_x1_g6.md
Created April 18, 2020 21:50
Update BIOS on ThinkPad X1 Carbon Gen 6th (Ubuntu 18.04, Legacy mode)

Update BIOS on ThinkPad X1 Carbon Gen 6th (Ubuntu 18.04)

Laptop (ThinkPad) Lenovo X1 Carbon 6th Gen (Type 20KH, 20KG)

If you are using your ThinkPad X1G6 with Linux in "Legacy only" mode, there's only one way how to update BIOS - you should use "BIOS Update (Bootable CD)". So this is a step by step guid how to do it.

Check current BIOS version:

fwupdmgr get-devices