This file contains 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
function _csvRowToArray(csv) { | |
const csvRegex = /,(?=(?:(?:[^"]*"){2})*[^"]*$)/ | |
const trimQuotes = /^"|"$/g | |
return csv.split(csvRegex).map(h => h.trim().replace(trimQuotes, '')) | |
} | |
function _csvRowToObject(headers, row) { | |
let currentRow = _csvRowToArray(row) | |
return Object.fromEntries(headers.map((header, i) => [header, currentRow[i]])) | |
} |
This file contains 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 argparse | |
import csv | |
from collections.abc import Generator | |
from contextlib import contextmanager, closing | |
from io import TextIOWrapper | |
from typing import Any | |
from django.core.management.base import BaseCommand | |
from django.db import transaction |
This file contains 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
<!doctype html><!-- This is a valid HTML5 document. --> | |
<!-- Screen readers, SEO, extensions and so on. --> | |
<html lang="en"> | |
<!-- Has to be within the first 1024 bytes, hence before the `title` element | |
See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset --> | |
<meta charset="utf-8"> | |
<meta name="color-scheme" content="light dark"> | |
<!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 --> | |
<!-- The viewport meta is quite crowded and we are responsible for that. | |
See: https://codepen.io/tigt/post/meta-viewport-for-2015 --> |
This file contains 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
async function nextFrame() { | |
return new Promise((resolve) => { | |
requestAnimationFrame(resolve) | |
}) | |
} | |
async function randomDelay(min, max) { | |
const delay = Math.random() * (max - min) + min; | |
const startTime = performance.now() | |
while (performance.now() - startTime < delay) { |
This file contains 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 | |
function optimize | |
{ | |
echo $1 | |
filesize=`stat -f %z "$1"` | |
if [[ $filesize -lt 10000 ]]; then | |
jpegtran -copy none -optimize "$1" > "$1.bak" | |
echo "pet | |
else |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0"> | |
<channel> | |
<title>Microsoft Edge Dev Blog</title> | |
<atom:link href="https://blogs.windows.com/msedgedev/feed/" rel="self" type="application/rss+xml"/> | |
<link>https://blogs.windows.com/msedgedev</link> | |
<description>Official blog of the Microsoft Edge Web Platform Team</description> | |
<lastBuildDate>Fri, 24 Mar 2017 16:06:25 +0000</lastBuildDate> | |
<language>en-US</language> | |
<sy:updatePeriod>hourly</sy:updatePeriod> |
This file contains 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
In node_modules/mozilla-download/lib/download.js, add this in | |
function saveToTemp(err, url) { | |
var url = 'http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/2013-11-22-04-02-02-mozilla-central/b2g-28.0a1.multi.linux-x86_64.tar.bz2'; | |
then | |
rm -rf b2g && make b2g && ./bin/gaia-marionette apps/system/test/marionette/media_playback_test.js |
This file contains 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
09-23 16:06:56.679 E/RILD ( 118): **RIL Daemon Started** | |
09-23 16:06:56.679 E/RILD ( 118): **RILd param count=1** | |
09-23 16:06:57.059 E/RILD ( 118): RIL_Init argc = 5 client = 0 | |
09-23 16:06:59.879 E/RILPROXY( 112): Could not connect to rild socket, retrying: Connection refused | |
09-23 16:07:00.879 E/RILPROXY( 112): Could not connect to rild socket, retrying: Connection refused | |
09-23 16:07:01.879 E/RILPROXY( 112): Could not connect to rild socket, retrying: Connection refused | |
09-23 16:07:02.879 E/RILPROXY( 112): Could not connect to rild socket, retrying: Connection refused | |
09-23 16:07:03.429 W/RILC ( 118): RIL_onUnsolicitedSendResponse called before RIL_register | |
09-23 16:07:03.439 E/RILC ( 118): RIL_register: RIL version 6 | |
09-23 16:07:03.439 E/RILC ( 118): s_registerCalled = 1, s_started = 1, RIL_getMaxNumClients = 1 |
This file contains 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
D/RILC ( 113): UI --- RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE (15) ---> RIL [RID 0, token id 701, data len 0] | |
D/RILC ( 113): RID 0 corresponds to as_id 0 | |
D/RILC ( 113): [RID 0] ReqList entries : | |
D/RILC ( 113): RIL_REQUEST_QUERY_AVAILABLE_NETWORKS (48), token id 630 | |
D/RILC ( 113): RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE (15), token id 698 | |
D/RILC ( 113): RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE (15), token id 701 | |
D/RILC ( 113): RIL=>AMSS [ label = "cm_mm_call_sups_per_subs()" ]; | |
D/RILC ( 113): RID 0 MID 0 Received CM_CALLSVC_COMMAND_CALLBACK : Req ID 852 | |
D/RILC ( 113): RID 0 MID 0 Queued event CM_COMMAND_CALLBACK (12 bytes) | |
D/RILC ( 113): qcril_event_main(): 1 items on queue |
This file contains 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
TypeError: Cannot read property 'body' of undefined | |
at Request._callback (/Users/rik24d/code/travis-scrape-gaia/node_modules/travis-ci/lib/travis-http.js:32:40) | |
at self.callback (/Users/rik24d/code/travis-scrape-gaia/node_modules/travis-ci/node_modules/request/index.js:148:22) | |
at Request.EventEmitter.emit (events.js:95:17) | |
at ClientRequest.self.clientErrorHandler (/Users/rik24d/code/travis-scrape-gaia/node_modules/travis-ci/node_modules/request/index.js:257:10) | |
at ClientRequest.EventEmitter.emit (events.js:95:17) | |
at CleartextStream.socketCloseListener (http.js:1523:9) | |
at CleartextStream.EventEmitter.emit (events.js:117:20) | |
at tls.js:688:10 | |
at process._tickCallback (node.js:415:13) |
NewerOlder