Skip to content

Instantly share code, notes, and snippets.

View tylermercer's full-sized avatar

Tyler Mercer tylermercer

View GitHub Profile
@tylermercer
tylermercer / convertToAstro.js
Last active June 9, 2024 03:24
Responsive Image Sizes Calculator
/*
* This function can be applied to the results in the above's `computeSizes` to output the results as a `widths` and `sizes` attribute
* to be used in an Astro project
*/
const convertToAstroCode = (obj) => {
const result = {};
Object.keys(obj).forEach((key) => {
const measurements = obj[key];
@tylermercer
tylermercer / AsyncProvider.ts
Last active April 2, 2021 16:43
Asynchronously Providing a Value in Vue3
/* eslint vue/no-setup-props-destructure: 0 */
import { defineComponent, createVNode as h, ref, provide } from "vue"
const createInnerProvider = <T> () => {
return defineComponent({
props: {
toProvide: {
type: Object as () => T
},
@tylermercer
tylermercer / jar_merger.sh
Last active August 13, 2018 20:06
A simple bash script for merging JAR files
#!/bin/bash/
#Based on http://sureshatt.blogspot.com/2012/03/unzip-all-jars-at-once.html
#Command line args are ($1) the directory to pull jars from and ($2)
mkdir unzippedjarfilesthatwillbemerged;
x=0;
ls -1 $1/*.jar > filelist
for filename in `cat filelist`
do
### Keybase proof
I hereby claim:
* I am tylermercer on github.
* I am tylermercer (https://keybase.io/tylermercer) on keybase.
* I have a public key ASBfh8djhhBZhJZ73MQnyIBIdpz8sGR6p2Vs8wVJvMHmRQo
To claim this, I am signing this object: