You have discovered a soft spot in the terminology that amateurs use to talk about programming languages. Don't use the terms "strong" and "weak" typing, because they don't have a universally agreed on technical meaning. By contrast, static typing means that programs are checked before being executed, and a program might be rejected before it starts. Dynamic typing means that the types of values are checked during
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
// Crossbrowser event attacher. | |
var addEventListener = function (elem, evento, handler) { | |
console.assert(elem.addEventListener || elem.attachEvent, "Can't find an event handler."); | |
if (elem.addEventListener) { | |
elem.addEventListener(evento, function (e) { | |
if (handler.call(elem, e) === false) | |
e.preventDefault(); | |
}); | |
} else if (elem.attachEvent) { | |
elem.attachEvent('on' + evento, function (e) { |
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/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD | grep -Po '[A-Z]{4}-[0-9]{4,5}') | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
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
set noautofocus | |
map m* setMark | |
map <A-p> pinTab | |
map <C-h> previousTab | |
map <C-l> nextTab | |
map <C-j> scrollFullPageDown | |
map <C-k> scrollFullPageUp | |
map $ lastTab | |
" Open new tab with current URL | |
map T :tabnew @%<CR> |
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 bb | |
;; Run it using [babashka](https://github.com/borkdude/babashka) | |
;; > bb -f tag-buckets.clj | |
;; Related info: https://stackoverflow.com/questions/52645443/how-to-add-tags-to-an-s3-bucket-without-deleting-the-existing-tags-using-boto3 | |
(defn parse [str] | |
(json/parse-string str true)) | |
(defn print [data] |
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
FTPs | |
Fetching | |
fetch-success -> List | |
fetch-failure -> List | |
# Only state where main layout controls are enabled | |
List | |
new-ftp -> Creating FTP | |
delete-ftp -> Sure delete FTP | |
test-ftp -> Sure test FTP | |
Creating FTP |
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
Order | |
Fetching | |
fetched -> List | |
fetching-error -> List | |
List | |
resend-confirmation -> ResendingConfirmation | |
download -> Downloading | |
refund -> ConfirmRefund | |
ResendingConfirmation | |
resend-confirmation -> ResendConfirmationSuccess |
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
(defn get-file-splits | |
[size-in-bytes mb-per-split] | |
(let [num-parts (Math/ceil (/ size-in-bytes mb-per-split))] | |
(map | |
(fn [part-num] | |
{::part-number (inc part-num) | |
::start-pos (if (zero? part-num) | |
0 | |
(inc (* part-num mb-per-split))) | |
::max-bytes-to-transfer mb-per-split}) |
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
(defn get-file-splits | |
[size-in-bytes mb-per-split] | |
(let [num-parts (Math/ceil (/ size-in-bytes mb-per-split))] | |
(map | |
(fn [part-num] | |
{::part-number (inc part-num) | |
::start-pos (if (zero? part-num) | |
0 | |
(inc (* part-num mb-per-split))) | |
::max-bytes-to-transfer mb-per-split}) |
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
(defn all-settled [promises] | |
(js/Promise. | |
(fn [resFn _] | |
(let [state (atom {:resolutions (vec (repeat (count promises) nil)) | |
:counter 0}) | |
process (fn [idx type] | |
(fn [val] | |
(swap! state | |
(fn [{:keys [resolutions counter]}] | |
{:resolutions (assoc resolutions idx |
OlderNewer