docker image build --squash -t image-name:tag .
Run the image then export the running image and save to the image repository using import
docker run ... image-name:tag
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
| const db = [ | |
| { | |
| name: 'John Doe', | |
| age: 28, | |
| lastModified: Date.now(), | |
| lastAccessed: Date.now() | |
| }, | |
| { | |
| name: 'Jane Smith', | |
| age: 30, |
| #!/usr/bin/env bash | |
| # Port of https://github.com/tj/node-prune to bash | |
| # Also, | |
| # - fixed "*.ts" being overzealous and killing .d.ts files | |
| # - added some more file types from https://github.com/npm/npm/issues/5264#issuecomment-259800486 | |
| # | |
| # See also: | |
| # - https://github.com/timoxley/cruft | |
| # - https://yarnpkg.com/en/docs/cli/autoclean | |
| # - https://github.com/ModClean/modclean |
Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.
However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.
| import { createCipheriv, createDecipheriv, randomBytes } from "crypto"; | |
| const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters) | |
| const IV_LENGTH: number = 16; // For AES, this is always 16 | |
| /** | |
| * Will generate valid encryption keys for use | |
| * Not used in the code below, but generate one and store it in ENV for your own purposes | |
| */ | |
| export function keyGen() { |
| const subscribeMiddleware = () => store => { | |
| let handlers = []; | |
| store.subscribe = (cb) => { | |
| handlers = handlers.concat(cb); | |
| const removeSubscriber = () => { handlers = handlers.filter(fn => fn !== cb) }; | |
| return removeSubscriber; | |
| }; | |
| return next => (action) => { |
| ### Full command line options | |
| ``` | |
| ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4 | |
| ``` | |
| ### Notie | |
| * output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS. |
| // Babel 2015 - ES6 | |
| // Convert a complex JS Object to GraphQL Query, should handle most use cases as of 21/01/2016 | |
| const o = { | |
| query: { | |
| fields: { | |
| complex: { | |
| aliasFor: "Products", | |
| processArgs: { | |
| coupon: (value) => { | |
| return `"${JSON.stringify(value).replace(/"/g, "\\\"")}"`; // passing json string as a argument |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |