- Terminate all docker processes -
docker kill docker ps -q
docker kill docker ps -q
| import io from 'socket.io-client'; | |
| import getBaseUrl from '../../../utils/get-base-url'; | |
| let mSocket: null | SocketIOClient.Socket = null; | |
| let mIsConnecting = false; | |
| /** | |
| * Create io.socket if it doesn't exist. If it does, and it's disconnected | |
| * then reconnect it. If io.socket is in process of connecting, this will |
| in package.json scripts: | |
| scripts: { | |
| ... | |
| "preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') === -1) { console.error('\\u001b[31mPlease use yarn for installing\\u001b[0m'); process.exit(1); }\"" | |
| ... | |
| } |
| yarn jest CurrentSchedulesScreen --watch | |
| if (typeof unreg !== 'undefined') unreg(); | |
| function logOnline() { | |
| console.log('ONLINE', new Date().toLocaleTimeString()) | |
| } | |
| function logOffline() { | |
| console.log('offline', new Date().toLocaleTimeString()) | |
| } | |
| function reg() { | |
| window.addEventListener('online', logOnline); |
| pre(3); // log "hit" 3 times | |
| post(3); // log "hit" 4 times | |
| function pre(depth) { | |
| let i=0; | |
| while (true) { | |
| console.log('hit'); | |
| if (++i === depth) return; | |
| } | |
| } |
with string of "file:///var/mobile/Containers/Data/Application/4CA477FA-1C4C-41C0-AF8D-094F364DE3BA/Documents/com.zillow.zo.rpm.dev/7C3DBCAA-0DC9-4224-A4D2-26803F032644.jpg"
doing:
let urlString = path as String
let url = NSURL(string: urlString)! as URL
url.path gives "/var/mobile/Containers/Data/Application/50235058-BF69-4311-A668-67D13F1566CA/Documents/com.zillow.zo.rpm.dev/7C3DBCAA-0DC9-4224-A4D2-26803F032644.jpg"
// server down
{ Error: connect ECONNREFUSED 127.0.0.1:1337
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1061:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 1337 }
| STATUS_CODES: | |
| { '100': 'Continue', | |
| '101': 'Switching Protocols', | |
| '102': 'Processing', | |
| '103': 'Early Hints', | |
| '200': 'OK', | |
| '201': 'Created', | |
| '202': 'Accepted', | |
| '203': 'Non-Authoritative Information', | |
| '204': 'No Content', |
| /** | |
| * A caveat is that an observer, referentially, can ONLY subscribe to one type. | |
| * I can fix this in the future, but for now, I don't have a need. | |
| * | |
| * @param {"connect" | "reconnect" | "disconnect"} type | |
| * @param {Function} observer | |
| * @param {Object<string, any>} options | |
| * @param {boolean} [options.shouldMulti] - Set to true if you want the observer to stay subscribed after first trigger. By default, it will be removed after first trigger. | |
| * |