Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
import type { Handle, GetSession } from '@sveltejs/kit'; | |
import * as cookie from 'cookie'; | |
import * as jsonwebtoken from 'jsonwebtoken'; | |
import { handleTokenRefresh } from '$lib/helpers/refresh'; | |
import { JWT_SECRET } from './env'; | |
const getJWT = (cookie: string): jsonwebtoken.Jwt => { | |
if (typeof cookie !== 'string' || cookie.length === 0) return; | |
return jsonwebtoken.decode(cookie, { complete: true }); |
This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).
Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.
When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.
Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex
command line tool.
To learn more about migrations, check out this article on the different types of database migrations!
let itemIDs = [1, 2, 3, 4, 5]; | |
itemIDs.reduce((promise, itemID) => { | |
return promise.then(_ => api.deleteItem(itemID)); | |
}, Promise.resolve()); |
This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf
var Shopify = Shopify || {}; | |
// --------------------------------------------------------------------------- | |
// Money format handler | |
// --------------------------------------------------------------------------- | |
Shopify.money_format = "${{amount}}"; | |
Shopify.formatMoney = function(cents, format) { | |
if (typeof cents == 'string') { cents = cents.replace('.',''); } | |
var value = ''; | |
var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/; | |
var formatString = (format || this.money_format); |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
Working with DOM | Working with JS | Working With Functions |
---|---|---|
Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
Create DOM Elements | Conditionals |
(from Understanding Nginx Server and Location Block Selection Algorithms - https://goo.gl/YyzshP)
server {
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |