As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
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 { writable } from 'svelte/store'; | |
import { browser } from '$app/env'; | |
const setAsync = async (key: string, value: any): Promise<void> => { | |
return Promise.resolve().then(() => { | |
typeof value != 'string' | |
? localStorage.setItem(key, JSON.stringify(value)) | |
: localStorage.setItem(key, value); | |
}); | |
} |
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
/* | |
It's now a package. You can find it here: | |
https://github.com/joshnuss/svelte-local-storage-store | |
*/ | |
// Svelte store backed by window.localStorage | |
// Persists store's data locally |
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
Alberta | |
British Columbia | |
Manitoba | |
New Brunswick | |
Newfoundland and Labrador | |
Northwest Territories | |
Nova Scotia | |
Nunavut | |
Ontario | |
Prince Edward Island |
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
#!/bin/bash | |
find . -name "Icon?" -print0 | xargs -0 rm -rf |
Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.
Once you have a remote set up for one of your upstreams, run these commands with:
git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]
Once set up, git remote -v
should show two (push) URLs and one (fetch) URL. Something like this: