export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
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 csv | |
import json | |
with open('data/ref_language.csv') as csvfile: | |
reader = csv.DictReader(csvfile) | |
fieldnames = reader.fieldnames | |
output = [] | |
for row in reader: | |
j = {} | |
for i, _ in enumerate(fieldnames): |
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
window.fetch('/v1/webpush', { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify(body) | |
}).then((body) => { | |
return body.json() | |
}) |
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
var start = new Date(); | |
var hrstart = process.hrtime(); | |
setTimeout(function (argument) { | |
// execution time simulated with setTimeout function | |
var end = new Date() - start, | |
hrend = process.hrtime(hrstart); | |
console.info("Execution time: %dms", end); | |
console.info("Execution time (hr): %ds %dms", hrend[0], hrend[1]/1000000); |
In order to scrape golang data, it needs to be enabled in the python.conf.d
:
// python.conf.d
go_expvar: yes
You also need to import expvar
in the golang file
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 math | |
from concurrent.futures import ThreadPoolExecutor, wait, as_completed | |
from time import time | |
x = [] | |
for i in range(105): | |
x.append(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
const data = { | |
hello: 'world', | |
someInteger: 1, | |
aFloat: 1.40, | |
isTrue: false, | |
items: [1, 2, 3] | |
} | |
function toReadme(data) { |
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> | |
<html> | |
<head> | |
<title>localStorage Test</title> | |
<script type="text/javascript" > | |
var count = 0; | |
var storageHandler = function () { | |
alert('storage event 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
const data = require('./data/jobs.json') | |
const fs = require('fs') | |
const jobs = data.jobs.recordsets[0] | |
const d = jobs.reduce((obj, job) => { | |
Object.keys(job).map((j) => { | |
if (!obj[j]) { | |
obj[j] = job[j] | |
} | |
}) |