Thanks for coming! Enjoy the rest of Techorama!
- Slides added within 24 hrs of the presentation
- Chain of Responsibility fix your cross-cutting concern pain
- Maintain Legacy Code with New Code
- Ardalis.Specification fix your repository pain
Thanks for coming! Enjoy the rest of Techorama!
| const compareColor = (color, property) => (targetElement) => { | |
| const tempElement = document.createElement('div'); | |
| tempElement.style.color = color; | |
| tempElement.style.display = 'none'; // make sure it doesn't actually render | |
| document.body.appendChild(tempElement); // append so that `getComputedStyle` actually works | |
| const tempColor = getComputedStyle(tempElement).color; | |
| const targetColor = getComputedStyle(targetElement[0])[property]; | |
| document.body.removeChild(tempElement); // remove it because we're done with it |
| import { Ref, reactive, onMounted, watch, toRefs } from '@vue/composition-api' | |
| // const { data, error } = useSWR('/api/user', fetcher) | |
| export type fetcherFn<Data> = (...args: any) => Data | Promise<Data> | |
| function isDocumentVisible (): boolean { | |
| if ( | |
| typeof document !== 'undefined' && | |
| typeof document.visibilityState !== 'undefined' | |
| ) { |
use git diff to generate file list
git diff --name-only master
add ext filter
| "use strict"; | |
| // Generate webpack config with CLI service | |
| const webpackConfig = require("@vue/cli-service/webpack.config.js"); | |
| // Create express app | |
| const express = require("express"); | |
| const app = express(); | |
| // Configure webpack as middleware |
| #!/bin/bash | |
| # Launch inside a create-react-app project after building the production build. | |
| # Require `jq`. | |
| diff \ | |
| <(find src -type f \( -name '*.js' -o -name '*.jsx' -o -name '*.css' \) | sort) \ | |
| <(cat build/**/*.map | jq --raw-output '.sources | join("\n")' \ | |
| | grep -v '\.\./' | grep -E '\.(js|jsx|css)$' \ | |
| | sed "s#^#src/#" | sort | uniq) \ |
| // UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
| // does not support `nomodule` is probably not being used anywhere. The code below is left | |
| // for posterity. | |
| /** | |
| * Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
| * load <script nomodule> anyway. This snippet solve this problem, but only for script | |
| * tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
| * | |
| * Again: this will **not** prevent inline script, e.g.: |
| # set the base image to Debian | |
| # https://hub.docker.com/_/debian/ | |
| FROM debian:latest | |
| # replace shell with bash so we can source files | |
| RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
| # update the repository sources list | |
| # and install dependencies | |
| RUN apt-get update \ |