Skip to content

Instantly share code, notes, and snippets.

View jsmith's full-sized avatar
👨‍💻

Jacob jsmith

👨‍💻
View GitHub Profile
import * as Icons from "@graywolfai/react-heroicons";
export const lookup = {
AcademicCapOutline: Icons.AcademicCapOutline,
AcademicCapSolid: Icons.AcademicCapSolid,
AdjustmentsOutline: Icons.AdjustmentsOutline,
AdjustmentsSolid: Icons.AdjustmentsSolid,
AnnotationOutline: Icons.AnnotationOutline,
AnnotationSolid: Icons.AnnotationSolid,
ArchiveOutline: Icons.ArchiveOutline,
@jsmith
jsmith / save.js
Created March 23, 2020 19:31
Easy Saving
const save = (data: any, filename: string) => {
if (!data) {
console.error('Console.save: No data')
return
}
if (!filename) filename = 'console.json'
if (typeof data === 'object') {
data = JSON.stringify(data, undefined, 4)
@jsmith
jsmith / bonus1.js
Last active February 11, 2020 22:49
function kSmallest(A, B, k) {
// bounds are inclusive so we are subtracting 1
// we also subtract 1 from k due to 0 based indexing
return helper(A, B, k - 1, 0, A.length - 1, 0, B.length - 1);
}
function helper(A, B, k, s1, e1, s2, e2) {
// Base case:
// If one of the arrays is empty, then it's obviously the kth element of the
// other array.
@jsmith
jsmith / workout.md
Created January 27, 2020 23:12
Workout

Warm-up: Dynamic Stretches (5-10min)

Yuri's Shoulder Band Warmup (5-10)

With band, start pointing straight back, bring to back, bring around head (shoulder to shoulder) and then back to starting position.

Squat Sky Reaches (5-10)

Do a wide squat and then twist torse so that one side of your body is pointing upwards and the other downwards. You can do these assisted.

@jsmith
jsmith / Test.vue
Created June 28, 2019 11:25
vue-function-api
<template>
</template>
<script lang="ts">
import Vue, { ComponentOptions, PropOptions as VuePropOptions, PropType } from 'vue';
import { Context } from 'vue-function-api/dist/types/vue';
type J = StringConstructor extends StringConstructor ? string : never;
@jsmith
jsmith / console.c
Last active January 29, 2019 12:24
A2
#include "fsl_device_registers.h"
#include "console.h";
/**
* Set the baud rate to 9600
* Date bits -> 7
* Stop bits -> 1
* Disabled Parity & Flor control
*/
void UARTx_Interface_Init() {
@jsmith
jsmith / useful.sh
Last active July 10, 2018 21:19
Useful Commands
# Deletes all stale remote-tracking branches under <name>. These stale branches have
# already been removed from the remote repository referenced by <name>, but are still
# locally available in “remotes/<name>”.
git remote prune origin
# ctrl-e = go to end of line
# ctrl-a = go to start of line
# ctrl-k = Kill
# ctrl-u = Kill backwards
# ctrl-w = Kill word backwards
@jsmith
jsmith / bootstrap.sh
Last active July 23, 2018 00:06
Ubuntu Bootstrap
set -e # exit on error
sudo -v # require sudo
if_repository () {
return git rev-parse 2> /dev/null; [ $? == 0 ] && echo 1
}
filenames=("$HOME/.ssh/id_rsa" "$HOME/.ssh/id_rsa.pub")
for filename in $filenames; do
if [ ! -e $filename ]; then