With 2^0 = 1 bit signed integers, Unix time will overflow on: 00:00:01 UTC January 01, 1970
With 2^0 = 1 bit unsigned integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit signed integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit unsigned integers, Unix time will overflow on: 00:00:04 UTC January 01, 1970
With 2^2 = 4 bit signed integers, Unix time will overflow on: 00:00:08 UTC January 01, 1970
With 2^2 = 4 bit unsigned integers, Unix time will overflow on: 00:00:16 UTC January 01, 1970
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # resize all images in a directory | |
| from PIL import Image | |
| import os | |
| path = "D:/TMP/input/" | |
| resize_ratio = 0.25 | |
| def resize_aspect_fit(): |
curl https://git.io/ -i -F "url=URL" -F "code=XXX"https://*.github.com/*https://*.github.io/*https://*.githubusercontent.com/*
- Understanding (all) JavaScript module formats and tools
- What are CJS, AMD, UMD, and ESM in Javascript?
- On inventing JS module formats and script loaders
- Basics of the JavaScript module system
- Why AMD?
- ES modules: A cartoon deep-dive
rollup.config.js
import {getBabelOutputPlugin} from '@rollup/plugin-babel';This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
Generate root.pem, root.key & root.crt:
https://mrkunz.com/blog/08_22_2018_VEX_Wrangle_Cheat_Sheet.html
f@Frame |
The current floating frame number, equivalent to the $FF Hscript variable |
f@Time |
The current time in seconds, equivalent to the $T Hscript variable |
i@SimFrame |
The integer simulation timestep number ($SF), only present in DOP contexts |
f@SimTime |
The simulation time in seconds ($ST), only present in DOP contexts |
f@TimeInc |
The timestep currently being used for simulation or playback |
| - | - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hou | |
| import os | |
| def fit(input, oldmin, oldmax, newmin, newmax): | |
| return (((input - oldmin) * (newmax - newmin)) / (oldmax - oldmin)) + newmin | |
| def tile_camera(path_cam, path_rop, tiles_x=2, tiles_y=2): | |
| debug = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| CURRENT_DIR=$(pwd) | |
| DOWNLOAD_URL="https://www.perforce.com/downloads/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz" | |
| DOWNLOAD_DIR="${CURRENT_DIR}/tmp_perforce_download/" | |
| sudo rm -rf "${DOWNLOAD_DIR}" | |
| sudo mkdir "${DOWNLOAD_DIR}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # curl https://gist_raw_url -sSLf | bash | |
| set -e | |
| cweb_version=0.6.26 | |
| cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz | |
| curl -Lo cargo-web.gz $cweb | |
| gunzip cargo-web.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const _REALM = 'Secure Area'; | |
| const _DEFAULT_USERNAME = 'username'; | |
| const _DEFAULT_PASSWORD = null; | |
| addEventListener('fetch', (event) => { | |
| event.respondWith(handleRequest(event.request)); | |
| }); | |
| async function handleRequest(request) { | |
| const password = await getValidCredentials(request); |
OlderNewer