Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Jacob jsmith

👨‍💻
View GitHub Profile
View heroicons-lookup.js
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 Mar 23, 2020
Easy Saving
View save.js
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)
View bonus1.js
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.
View workout.md

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 Jun 28, 2019
vue-function-api
View Test.vue
<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;
View console.c
#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 Jul 10, 2018
Useful Commands
View useful.sh
# 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 Jul 23, 2018
Ubuntu Bootstrap
View bootstrap.sh
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