In order to easily build, I made sets of patches that resolved conflicts (chacha20-poly1305, camellia-gcm, equal-preference-group).
- Required packages:
packaging-dev,lzip/ Preparation:sudo apt-get build-depopenssloropenssl1.0
| #!/usr/bin/env node | |
| /** | |
| Demostrate a practical use case with Bluebird promise api. | |
| Read a line delimited file and store into sqlite3 db. | |
| Promise.promisifyAll - Converting synchromous api's to Async. | |
| Promise.using and Promise.disposer - Resource managment. | |
| Promise.map and Promise.spread - Leveraging arrays in promises. |
| <script> | |
| // A minimal polyfill for copying text to clipboard that works most of the time in most capable browsers. | |
| // Note that: | |
| // - You may not need this. `navigator.clipboard.writeText()` works directly in all modern browsers as of 2020. | |
| // - In Edge, this may call `resolve()` even if copying failed. | |
| // - In Safari, this may fail if there is nothing selected on the page. | |
| // See https://github.com/lgarron/clipboard-polyfill for a more robust solution. | |
| // | |
| // License for this Gist: public domain / Unlicense | |
| function writeText(str) { |
| export _ps1_timer | |
| function _ps1_timer_start { | |
| # echo START | |
| _ps1_timer=${_ps1_timer:-`gdate +%s%N 2> /dev/null || date +%s%N`}; | |
| } | |
| function _ps1_timer_stop { | |
| # echo STOP | |
| if [ -z "$_ps1_timer" ]; then |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| # put this in the same folder as the script | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| # edit "wpoison" and "members" to your liking, don't forget to change the wpoison.php filename if you modified it | |
| # make sure the "wpoison" regex matches the "wpoison".php filename. | |
| #RewriteRule wpoison$ /members/wpoison.php | |
| #RewriteRule wpoison/(.*)$ /members/wpoison.php |
| # Install Docker on Xenial 16.04.1 x64 | |
| # Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
| # No interactive for now. | |
| export DEBIAN_FRONTEND=noninteractive | |
| # Update your APT package index. | |
| sudo apt-get -y update | |
| # Update package information, ensure that APT works with the https method, and that CA certificates are installed. | |
| sudo apt-get -y install apt-transport-https ca-certificates | |
| # Add the new GPG key. | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
| #!/bin/bash | |
| # | |
| # Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/ | |
| # Adapted to work with the official image available into Mac App Store | |
| # | |
| # Enjoy! | |
| hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
| hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J | |
| hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build |
| (function () { | |
| 'use strict'; | |
| /** | |
| * wraps a promise in a timeout, allowing the promise to reject if not resolve with a specific period of time | |
| * @param {integer} ms - milliseconds to wait before rejecting promise if not resolved | |
| * @param {Promise} promise to monitor | |
| * @example | |
| * promiseTimeout(1000, fetch('https://courseof.life/johndoherty.json')) |
In order to easily build, I made sets of patches that resolved conflicts (chacha20-poly1305, camellia-gcm, equal-preference-group).
packaging-dev, lzip / Preparation: sudo apt-get build-dep openssl or openssl1.0| 'use strict' | |
| const timeout = ms => new Promise(res => setTimeout(res, ms)) | |
| function convinceMe (convince) { | |
| let unixTime = Math.round(+new Date() / 1000) | |
| console.log(`Delay ${convince} at ${unixTime}`) | |
| } | |
| async function delay () { |