Skip to content

Instantly share code, notes, and snippets.

View pevey's full-sized avatar

Lacey Pevey pevey

View GitHub Profile
<script>
import { signOut as authSignOut } from 'sk-auth/client';
import { session } from '$app/stores';
// getting the user from the session store
$: user = $session.user;
function signIn() {
location.assign('/api/auth/signin/cognito?redirect=/');
}
@zephraph
zephraph / npm-canary.md
Last active August 19, 2024 22:39 — forked from schmich/npm-prerelease.md
Publish a canary package on NPM
  • Update package.json by running yarn version --prerelease --preid=canary
  • Run npm publish --tag canary to publish the package under the canary tag
  • Run yarn add @artsy/reaction@canary to install canary package

Running npm dist-tag ls can be helpful to see what tagged packages are available

@fr-ser
fr-ser / debounce.ts
Last active July 15, 2023 15:12
Typed debounce function wtih TypeScript
export function debounce<F extends Function>(func:F, wait:number):F {
let timeoutID:number;
if (!Number.isInteger(wait)) {
console.warn("Called debounce without a valid number")
wait = 300;
}
// conversion through any necessary as it wont satisfy criteria otherwise
return <any>function(this:any, ...args: any[]) {
@capaj
capaj / module_parent_bar.js
Last active March 11, 2025 17:23
showcase of module.parent
var myFunc = require("./myFunc");
(function bar(){
myFunc("bar message");
})();