Skip to content

Instantly share code, notes, and snippets.

@AnalyzePlatypus
AnalyzePlatypus / vue-click-outside.md
Last active April 27, 2024 05:32
Vue.js 2.7: Detect clicks outside an element (Close modals, popups, etc.)

Detecting outside clicks in Vue.js

See this StackOverflow thread

First off, include the directive at the end of this gist.

  1. On your open button, make sure to use @click.stop to prevent the open click event from closing your modal.
  2. On your modal, add the v-click-outside directive and points it at a function to call when clicked outside.

Example:

@sapphi-red
sapphi-red / vite-4.3-perf.md
Last active April 27, 2024 05:32
Vite 4.3 performance

Terms

  • start up time: the time from "the command is executed" to the time "load event is triggered in browser".

  • root HMR time: the time from "the root file is changed" to the time "that file is executed in browser".

  • leaf HMR time: the time from "the leaf file is changed" to the time "that file is executed in browser".

  • cold start: the dependency optimization cache is deleted before each run

  • hot start: the dependency optimization cache exists by each run

Summary

<!DOCTYPE HTML>
<!--
Industrious by TEMPLATED
templated.co @templatedco
Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
-->
<html>
<head>
<title>GearCrunch</title>
<meta charset="utf-8"/>
@MartinMuzatko
MartinMuzatko / config.js
Last active April 27, 2024 05:31
Vuepress open graph metadata
let ogprefix = 'og: http://ogp.me/ns#'
let title = 'Wire Up Your Front-End'
let description = 'Get your personal guide to finally piece together the missing puzzles to communicate with your server'
let color = '#f42525'
let author = 'Martin Muzatko'
module.exports = {
title,
description,
serviceWorker: true,
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://private-repo.com/myrepo.git
> git init /var/jenkins_home/workspace/myrepo_master-2U3PIDBWVG233ME5SSYZKLF5UHTXGUK2VP7ZMOBNA6ANF3XH3KZA # timeout=10
Fetching upstream changes from https://private-repo.com/myrepo.git
> # semantic-release --debug [±master ●●]
[12:02:19 PM] [semantic-release] › ℹ Running semantic-release version 15.9.12
semantic-release:config options values: { branch: 'master',
semantic-release:config repositoryUrl: 'ssh://git@appserver.de:7999/sg/sicon.git',
semantic-release:config tagFormat: 'v${version}',
semantic-release:config analyzeCommits: { preset: 'angular' },
semantic-release:config verifyConditions: [],
semantic-release:config generateNotes: { preset: 'angular', parserOpts: {} },
semantic-release:config prepare: [ { path: '@semantic-release/changelog' } ],
semantic-release:config publish: [],
const { ConflictError, LockedError } = require('restify-errors');
const apps = require('./apps');
const { UpdateLockedError, UpdateDisabledError } = require('./exceptions');
module.exports = server => {
server.post('/Apps/update', async function (req, res, next) {
try {
let response = await apps.updateAll();
res.send(200, response);
next()
// go to website, run script, abort when needed with `clearTimeout(interval)`
// harvest when done with console.log(scrapes)
$i('axios')
const base = `http://www.echojs.com/latest/`
const timeout = 500
async function scrape(id = 0) {
const { data } = await axios.get(base + id)
document.body.innerHTML = data
const articles = document.body.querySelectorAll('#newslist article')
@w33ble
w33ble / design thinking.md
Last active April 27, 2024 05:30
Design Thinking

Design Thinking

A structured guide to the stuff you do anyway

design thinking diagram


Empathize

2 Chainz and Wiz Khalifa - We Own It
4 Non Blondes - What's Up .mp4
5 Seconds Of Summer - Amnesia
5 Seconds Of Summer - Beside You
5 Seconds Of Summer - Don't Stop
5 Seconds Of Summer - Good Girls
5 Seconds Of Summer - Heartbreak Girl
5 Seconds Of Summer - Hey Everybody!
5 Seconds Of Summer - Jet Black Heart
5 Seconds Of Summer - She Looks So Perfect