Skip to content

Instantly share code, notes, and snippets.

@1bardesign
1bardesign / conf.lua
Last active February 23, 2021 14:08
A little self-contained pomodoro timer for love2d
function love.conf(t)
t.window.width, t.window.height = 200, 60
t.window.x, t.window.y = 10, 10
t.window.borderless = true
t.window.title = "Pomodoro!"
end
@adactio
adactio / saveTextarea.js
Last active December 2, 2023 06:52
Put the contents of a textarea into localStorage if the user leaves the page before submitting the form.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function (win, doc) {
// Cut the mustard.
if (!win.localStorage) return;
// You should probably use a more specific selector than this.
var textarea = doc.querySelector('textarea');
// The key for the key/value pair in localStorage is the current URL.
var key = win.location.href;
@aslamdoctor
aslamdoctor / wsl-lamp.md
Last active December 7, 2023 13:46
Windows 10 - WSL LAMP Stack Setup
@jonathanbossenger
jonathanbossenger / sitesetup.sh
Last active April 25, 2024 23:13
Bash script to automatically provision LAMP sites
#!/bin/bash
# Bash script to set up local site using LAMP on Ubuntu
# Requires Apache2, MySQL, mkcert (https://github.com/FiloSottile/mkcert)
# See also sitedrop.sh https://gist.github.com/jonathanbossenger/4950e107b0004a8ee82aae8b123cce58
HOME_USER=jonathan
SSL_CERTS_DIRECTORY=/home/jonathan/ssl-certs
SITES_DIRECTORY=/home/jonathan/development/websites
@adactio
adactio / minimal-serviceworker.js
Last active August 18, 2023 09:15
An attempt at a minimal viable service worker.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
// HTML files: try the network first, then the cache.
// Other files: try the cache first, then the network.
// Both: cache a fresh version if possible.
// (beware: the cache will grow and grow; there's no cleanup)
const cacheName = 'files';
@Pustur
Pustur / daily-ui.md
Last active April 20, 2024 18:39
DailyUI – A list of every DailyUI design challenge

All DailyUI Challenges

  1. Sign Up
  2. Credit Card Checkout
  3. Landing Page (above the fold)
  4. Calculator
  5. App Icon
  6. User Profile
  7. Settings
  8. 404 page
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@adactio
adactio / basicServiceWorker.js
Last active March 27, 2023 09:30
A basic Service Worker, for use on, say, a blog.
'use strict';
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function() {
// Update 'version' if you need to refresh the cache
var staticCacheName = 'static';
var version = 'v1::';
@carolineschnapp
carolineschnapp / instructions.md
Last active June 21, 2021 20:35
Turn off the 'more' feature in navigation. #navigation #supply
// When we give an element some ‘attention’.
@mixin attention() {
&:hover,
&:active,
&:focus {
@content;
}
}