Format JavaScript Array of Strings to Oxford Comma
const toOxfordComma = (array) =>
array.length === 2
? array.join(' and ')
: array.length > 2
? array
.slice(0, array.length - 1)
.concat(`and ${array.slice(-1)}`)
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: deep-blue; icon-glyph: grimace; | |
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// Corona Zahlen Hamburg | https://www.hamburg.de/corona-zahlen | |
// Credits: | |
// kevinkub https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664 | |
// rphl https://gist.github.com/rphl/0491c5f9cb345bf831248732374c4ef5 | |
// eqsOne https://talk.automators.fm/t/widget-examples/7994/379 |
// dm Klopapier Widget | |
// | |
// Copyright (C) 2020 by marco79 <[email protected]> | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | |
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
//Fetches Random Images from the metmuseum-api ; Stores the ids in the keychain in order to prevent multiple calls | |
//Department ID = 11 is paintings ; use other if you wish | |
var keychainkey = "paintingIDs" | |
var res | |
if(!Keychain.contains(keychainkey)) { | |
console.log("Keychainentry does not exist... create it"); | |
const url = 'https://collectionapi.metmuseum.org/public/collection/v1/search?hasImages=true&medium=Paintings&departmentId=11&q=Painting' | |
const req = new Request(url) | |
res = await req.loadJSON() | |
let stringified = JSON.stringify(res) |
import argparse | |
import subprocess | |
import numpy as np | |
import scipy.io.wavfile | |
import scipy.ndimage | |
import webrtcvad | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--audio-path', '-i', required = True) | |
parser.add_argument('--sample-rate', '-r', type = int, default = 8_000, choices = [8_000, 16_000, 32_000, 48_000], help = 'Sample rate used to load and normalize audio (in Hz)') |
const toOxfordComma = (array) =>
array.length === 2
? array.join(' and ')
: array.length > 2
? array
.slice(0, array.length - 1)
.concat(`and ${array.slice(-1)}`)
Character code (character) | Duration (ms) | Alias to | Pronounced as |
---|---|---|---|
27 (�) | 656 | None | Escape |
33 (!) | 1333 | None | Exclamation mark |
35 (#) | 409 | None | Hash |
36 ($) | 425 | None | Dollar |
37 (%) | 631 | None | Percent |
38 (&) | 329 | None | And |
43 (+) | 396 | None | Plus |
45 (-) | 706 | None | Dash |
----------POSSIBLE OPTIONS---------------------------------------------- | |
--account : [optional] account name to login with | |
--key : [optional] connection key for the server (defaults to 1 in debug) | |
--automationRoutine : [optional] automation routine to run after login | |
--startAutomationGraph : [optional] start up and execute automation global graph using provided guid | |
--gatherEffectStats : [optional] enables effect stat gathering | |
--noautoconnect : [optional] Do not automatically connect to a server | |
--fastQuit | |
--dumpAssetNames : Write to <file> a JSON map of GUID (String "0xabc...") to asset name for all soft assets | |
--startPosition : [optional] start position when joining a map |
• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.
More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).
Interview is all about taking an ambiguous question of how you might build a system and letting
function Load { | |
param([scriptblock]$function, | |
[string]$Label) | |
$job = Start-Job -ScriptBlock $function | |
$symbols = @("⣾⣿", "⣽⣿", "⣻⣿", "⢿⣿", "⡿⣿", "⣟⣿", "⣯⣿", "⣷⣿", | |
"⣿⣾", "⣿⣽", "⣿⣻", "⣿⢿", "⣿⡿", "⣿⣟", "⣿⣯", "⣿⣷") | |
$i = 0; | |
while ($job.State -eq "Running") { | |
$symbol = $symbols[$i] |