Skip to content

Instantly share code, notes, and snippets.

View jstoone's full-sized avatar
🔥
Chameleon sports corvette with four buffalo-wing side door slide doors?

Jakob Steinn jstoone

🔥
Chameleon sports corvette with four buffalo-wing side door slide doors?
View GitHub Profile
@jstoone
jstoone / handle-file-upload-tus.ts
Last active November 2, 2023 16:18
Supabase: Resumable uploads RLS
const handleFileUploadTUS = async (formData: FormData) => {
const origFile = formData.get("audio") as File;
const file = new File([origFile], encodeURIComponent(origFile.name), {
type: origFile.type,
});
const {
data: { session },
} = await supabase.auth.getSession();
if (!session?.access_token) {
@jstoone
jstoone / UppyUpload.client.tsx
Created October 4, 2023 08:38
Supabase: Resumable upload with Uppy
import Uppy from "@uppy/core";
import { DragDrop, StatusBar } from "@uppy/react";
import Tus from "@uppy/tus";
import { useState } from "react";
// Don't forget the CSS: core and the UI components + plugins you are using.
function createUppy() {
// Adding to global `meta` will add it to every file.
// Every Uppy instance needs a unique ID.
@jstoone
jstoone / kill-ios-web-content.sh
Last active April 11, 2024 07:41
Kill WebKit.WebContent on Simulator
#/bin/bash
# Find process with name containing 'launchd_sim'
SIMULATOR_PID=$(pgrep launchd_sim)
echo "Simulator PID: $SIMULATOR_PID"
# Find sub-processes for the app's WebViews
WEBKIT_CONTENT_PID=$(pgrep -P $SIMULATOR_PID 'com.apple.WebKit.WebContent')
echo "WebKit WebContent PID(s):"
echo $WEBKIT_CONTENT_PID
@jstoone
jstoone / init.vim
Created November 25, 2018 16:07
Neovim config
"-----------------
" Init
"-----------------
if empty(glob('~/.config/nvim/autoload/plug.vim'))
" Auto-install vim-plug
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd!
autocmd VimEnter * PlugInstall
endif
@jstoone
jstoone / bot-feedback.md
Last active August 28, 2018 19:38
Feedback: Laracon EU Bot

Would it be possible to clear the "⭐️ date ⭐️" together with the menu It would remove a lot of clutter from the chat and only preserve the "success"-feedback about the talk being added.

Would it be possible to output my answer to edit|keep schedule or add|skip reminders? It would preserve the conversational context a bit more. It does not have to be a genuine message. A "You: Please edit"-line would suffice:

You are subscribed to notifications right before one of your subscribed talks will start. Still fine with that?
You: Yes please
Nice 👍 I will notify you then. See you around.
@jstoone
jstoone / keybase.md
Created April 25, 2017 21:14
Keybase

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@jstoone
jstoone / jstoone.pub
Created October 31, 2016 08:14
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNjk3CWNY3sT+NUPYelzYoWpDERAMoOkN2mMLLG3Jremc2zs9hclfKBEXefdaDgrtDPQadTNicQMDZ/QjMi+YCDxya1pzh2BIsoLWZvO2TVroax4HmBj2cJdaO2rSNYEVHCOc2blmGkP7dS8Srk8PxS3UkUsBIHbqVKBBjC67VHKqMr9E/hjfNVNI24bUgdX8t3cQBDijWFop/r0XyKYHgw9SSA8jXNLsSC9+wPbDg1w6DZ05OIHXe+9TzvqVqG0HZJChSRVWOmkVPda/1T+HkBhgQTlmaAWKX7PhYA1IfJ0ntuCu5KbvdgdoMq/y03jUkUe+izicrqlWwkMJxDykF [email protected]
@jstoone
jstoone / gtm-youtube-track.js
Created October 14, 2016 12:55
Tagmanager Youtube tracker
<script>
//enable the JavaScript API for an embedded player
for (var e = document.getElementsByTagName("iframe"), x = e.length; x--;)
if (/youtube.com\/embed/.test(e[x].src))
if(e[x].src.indexOf('enablejsapi=') === -1)
e[x].src += (e[x].src.indexOf('?') ===-1 ? '?':'&') + 'enablejsapi=1';
var gtmYTListeners = []; // support multiple players on the same page
// attach our YT listener once the API is loaded
function onYouTubeIframeAPIReady() {
@jstoone
jstoone / linedUp.php
Last active July 12, 2016 15:46
Slug stop words, in different flavors
<?php
$linedUp = $slugStopWords = [
'a',
'about',
'above',
'after',
'again',
'against',
'all',
@jstoone
jstoone / brew-me-mac.sh
Last active April 20, 2017 16:21
Mac install
##
# HOMEBREW
##
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Brew: install cli apps
brew install git node wget ag ack mplayer mpv vim
# Brew: get/tap brew cask
brew cask
# Brew: install desktop apps
brew cask install vlc firefox spotify iterm2 \ # everyday