Skip to content

Instantly share code, notes, and snippets.

View zaydek's full-sized avatar
🀠
Howdy!

Z πŸ΄β€β˜ οΈ zaydek

🀠
Howdy!
View GitHub Profile

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@pngwn
pngwn / ssg.md
Last active June 20, 2025 06:22
A Simple Svelte SSG.

The Simplest Svelte Static Site Generator

Assuming you don't want to statically export a Sapper app, most of the parts to build a simple SSG for Svelte already exist. The only thing that is missing is the tooling ('only').

However, you don't need a lot to get things going: just a couple of rollup builds and a config file will get you most of the way there. Just some glue.

What follows is a bunch of rambling, half thought out thoughts on how I would probably go about this. Most of the stuff discussed here is stuff I've actually done or half done or am in the process of doing with varying degrees of success. It is something I'll be spending more time on in the future. There are other things I have done, want to do, or think would be a good idea that are not listed here as they don't fall into the scope of a simple SSG.

*Dislaimer: This is how I would build an SSG, this isn't the only way, but I like this approach as there are a bunch of compile-time optimisations you can per

const MarkdownArray = [
// `<Comment />`.
{ syntax: /^\/\/(.*)(?:$|\n)/,
parser: (key, [children]) => <Comment key={key} children={parseText(children)} /> },
// `<Header />`.
{ syntax: /^(#{1,6})( .*)(?:$|\n)/,
parser: (key, [open, children]) => <Header key={key} open={open} children={parseText(children)} /> },
@dominijk
dominijk / readme.md
Last active October 19, 2024 04:40
ETL Ordnance Survey AddressBase Plus to Postgresql on a mac

Addressbase plus data loading to postgres on mac

The instructions in the official getting started are tailored to Windows and AddressBase premium. This is a simple guide for those working on mac using Addressbase Plus.

You should received a zip file with the following folder structure when unzipped;

ABFLGB_CSV
|
+-- data
|   |-- AddressBasePlus_FULL_2018-03-19_001.csv
@lukaskleinschmidt
lukaskleinschmidt / app.scss
Last active March 3, 2025 05:06
Utility class generator like tailwindcss but in pure Sass.
@use 'sass:map';
@use 'variants' as * with (
$breakpoints: (
'small': 640px,
'medium': 768px,
'large': 1024px,
'wide': 1280px,
)
);
@sbatson5
sbatson5 / multiple-firestore-queries.js
Last active February 26, 2020 09:35
Multiple firestore queries
const firebase = require('firebase');
function getCurrentEventsByStateForAdmins(state) {
const db = firebase.firestore();
db.collection('events')
.orderBy('expirationDate', 'asc')
.where('expirationDate', '>', new Date().toISOString())
.where('state', '==', state)
.where('isAdmin', '==', true)
package main
import (
"context"
"database/sql"
"encoding/base64"
"encoding/json"
"fmt"
"time"
@antfu
antfu / πŸ“Š Weekly development breakdown
Last active November 20, 2023 10:25
πŸ“Š Weekly development breakdown
TypeScript 21 hrs 47 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘ 67.1%
Vue.js 6 hrs 21 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 19.6%
JSON 2 hrs 10 mins β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.7%
JavaScript 46 mins β–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.4%
@danestves
danestves / aspect.css
Created February 13, 2020 22:53
Aspect Radios to use with tailwindcss
.embed-responsive {
@apply relative;
}
.embed-responsive::before {
@apply block;
content: "";
}
.embed-responsive .embed-responsive-item,
@graphicbeacon
graphicbeacon / main.dart
Last active September 17, 2021 01:46
Solution code on "Flutter for React developers" YouTube tutorial
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {