Skip to content

Instantly share code, notes, and snippets.

@vgrafe
vgrafe / something.js
Created September 23, 2021 19:40
adam-next
import useSession from next-auth
import useState from react
const usePlaidSession = () => {
const [linked, setLinked] = useState(false);
const [session, loading] = useSession();
const isLinked = linked || session.linked;
return {session, isLinked, loading, setLinked}
defaults write com.apple.dock autohide-time-modifier -float 0.4 && \
defaults write com.apple.dock autohide-delay -float 1000 && \
defaults write com.apple.dock autohide-time-modifier -int 0 && \
defaults write com.apple.dock static-only -bool true && \
defaults write com.apple.dock autohide -bool true && \
killall Dock
@vgrafe
vgrafe / Remove all git tags
Created April 12, 2018 13:47 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@vgrafe
vgrafe / player.js
Created May 26, 2017 13:33
excerpt of the videoplayer watchdog
// Setting the watchdog is done with the following. the app uses ReactJS as a framework.
// this is just the relevant part of the code.
componentDidMount() {
this.watchdog = setInterval(this.checkPlayerHealth, 500);
}
checkPlayerHealth = () => {
const delay = this.video.currentTime - this.state.debug.lastCheck;
if (!this.video.paused && delay < 0.1 // prob freezing
<!--
# The MIT License (MIT)
#
# Copyright (c) 2016 Microsoft. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
<!DOCTYPE html>
<html>
<head>
<title>Basic MediaPlayer</title>
<!-- the fopllowing files can be found here https://github.com/Microsoft/TVHelpers/tree/master/tvjs/src -->
<link href="../../../src/MediaPlayer/mediaplayer-1.0.0.0.css" rel="stylesheet" />
<script src="../../../src/DirectionalNavigation/directionalnavigation-1.0.0.0.js"></script>
<script src="../../../src/MediaPlayer/mediaplayer-1.0.0.0.js"></script>
# syncs editor font size with UI font size
# set initial value
document.documentElement.style.fontSize = (atom.config.get('editor.fontSize') - 2) + 'px'
# update value
atom.config.onDidChange 'editor.fontSize', ({newValue}) ->
document.documentElement.style.fontSize = (newValue - 2) + 'px'