Skip to content

Instantly share code, notes, and snippets.

View benaltair's full-sized avatar
Probably sailing

Ben benaltair

Probably sailing
View GitHub Profile
@braebo
braebo / asyncLocalStorageStore.ts
Created July 13, 2021 20:01
asyncLocalStorageStore for Sveltekit
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);
});
}
/*
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
@JayHoltslander
JayHoltslander / gist:c1c4e7f72e803a30a5466a69c5fe4927
Created February 21, 2018 01:04
List - Canadian Provinces.txt
Alberta
British Columbia
Manitoba
New Brunswick
Newfoundland and Labrador
Northwest Territories
Nova Scotia
Nunavut
Ontario
Prince Edward Island
@skounis
skounis / remove-icon.sh
Last active March 18, 2024 13:41
Remove Icon file in MacOS recursively
#!/bin/bash
find . -name "Icon?" -print0 | xargs -0 rm -rf
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 26, 2024 19:09
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

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.

Contents

@bjmiller121
bjmiller121 / multiple-push-urls.md
Last active March 4, 2024 05:47
Add multiple push URLs to a single git remote

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: