Skip to content

Instantly share code, notes, and snippets.

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function smoothScrollToTop(elemId) {
const speed = 1000; //ms
let targetY = document.querySelector(`#${elemId}`).offsetTop;
let curPos = window.scrollY;
let steps = 100;
@jasonwarta
jasonwarta / git-init.sh
Last active September 19, 2017 00:07
function that creates a git repo using the git API
git-init () {
# function that creates a git repo using the git API
# this function requires the following env variables to be set:
# GIT_USERNAME with your git username
# GIT_TOKEN with your git personal access token
#
# these are used when calling the api to create a new repo
# place the function code and env vars in your .bashrc or .profile

Keybase proof

I hereby claim:

  • I am jasonwarta on github.
  • I am jasonwarta (https://keybase.io/jasonwarta) on keybase.
  • I have a public key ASA8hJm9vgjvhgQCJ6ZxkxwgD1zyQ2JXRHtQn0I9V1LwUAo

To claim this, I am signing this object: