Skip to content

Instantly share code, notes, and snippets.

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:

@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
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;
window.onload = function(){
function textAreaAdjust(o) {
var elem = o.target;
elem.style.height = "1px";
elem.style.height = (10+elem.scrollHeight)+"px";
}
var elems = document.getElementsByTagName('textarea');
for(var ii=0;ii<elems.length;ii++){
#!/bin/bash
# run from the root of a directory with multiple projcts to see the status of all of them
# requires the git-prompt.sh program be located at the root of your home directory
FILES=`find . -maxdepth 1 -type d`
BASE=`pwd`
. ~/.git-prompt.sh
while read line; do
@jasonwarta
jasonwarta / cloudSettings
Last active January 28, 2019 22:50
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-28T22:50:21.232Z","extensionVersion":"v3.2.4"}
@jasonwarta
jasonwarta / App.js
Created January 2, 2019 10:14 — forked from shelldandy/App.js
nprogress with react-router in create-react-app
import React from 'react'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import routes from './routes'
import FancyRoute from './components/tools/FancyRoute'
const App = props =>
<Router>
<Switch>
{routes.map((route, i) =>
<FancyRoute key={i} {...route} />
@jasonwarta
jasonwarta / migrate-git-repo.sh
Last active January 6, 2019 03:10
script for migrating a git repo between services
# put this function in some file that will be loaded into your bash profile
# I personally use a dedicated sourced file for functions but it could also be placed
# in your .bashrc, .profile, or .bash_profile
# Usage:
# at a bash prompt, run
# migrate-repo <repo-url>
# the repo url could look like git@github.com:username/repo-name.git
function migrate-repo() {
new_repo_url=$1
@jasonwarta
jasonwarta / cloudSettings
Last active February 8, 2019 00:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-02-08T00:28:07.434Z","extensionVersion":"v3.2.4"}
@jasonwarta
jasonwarta / cloudSettings
Last active February 8, 2019 00:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-02-08T00:28:27.890Z","extensionVersion":"v3.2.4"}