I hereby claim:
- I am nickscript0 on github.
- I am nickscript0 (https://keybase.io/nickscript0) on keybase.
- I have a public key ASDVmINbkT5Bkt1i6E5r2EFd9lcvw7R9OTQbq6dhikhBwAo
To claim this, I am signing this object:
""" | |
Was running into the following error with the new async await syntax, where the equivalent @asyncio.coroutine did not give an error. | |
But this has since resolved, liekly due to an import problem or library version: | |
... | |
loop.run_until_complete(hello_world()) | |
File "/usr/local/lib/python3.5/site-packages/asyncio-3.4.3-py3.5.egg/asyncio/base_events.py", line 296, in run_until_complete | |
future = tasks.async(future, loop=self) | |
File "/usr/local/lib/python3.5/site-packages/asyncio-3.4.3-py3.5.egg/asyncio/tasks.py", line 516, in async | |
raise TypeError('A Future or coroutine is required') |
I hereby claim:
To claim this, I am signing this object:
python -m SimpleHTTPServer 8000
Current estimates for bruteforcing modern encryption algorithms
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
---------------------------------------
TLS -
// promisified fs.writeFile | |
export function writeFile(filename, data): Promise<void> { | |
return new Promise<void>((resolve, reject) => | |
fs.writeFile(filename, data, (err) => (err) ? reject(err) : resolve()) | |
); | |
} | |
// promisified fs.readFile | |
function readFile(filename): Promise<string> { | |
return new Promise<string>((resolve, reject) => |
From https://www.typescriptlang.org/docs/handbook/basic-types.html
const bool: boolean = true;
const num: number = 5;
const str: string = 'apple';
const numArr: number[] = [1, 2, 3];
const f: Function = () => 1;
// Place your settings in this file to overwrite the default settings | |
{ | |
"window.zoomLevel": 0, | |
"typescript.referencesCodeLens.enabled": false, | |
"editor.cursorBlinking": "solid", | |
"editor.minimap.enabled": false, | |
"workbench.colorCustomizations": { | |
"editor.lineHighlightBackground": "#585a6941" | |
} | |
} |
// Updated the original to include the new 'sticky' style in addition to 'fixed' https://alisdair.mcdiarmid.org/kill-sticky-headers/ | |
// Note to run this as a Chrome bookmark paste it in the URL field, prefixed with: javascript: | |
(function () { | |
var i, elements = document.querySelectorAll('body *'); for (i = 0; i < elements.length; i++) { | |
if (["sticky", "fixed"].includes(getComputedStyle(elements[i]).position)) { | |
elements[i].parentNode.removeChild(elements[i]); | |
} | |
} | |
} | |
)(); |
/** | |
* date-fns v2 is still in alpha, but has built-in Typescript support so best to use it: | |
* Docs: https://date-fns.org/v2.0.0-alpha.16/docs/Getting-Started | |
* | |
* npm install --save date-fns@next | |
*/ | |
// Useful functions to import | |
import { formatDistanceStrict, isAfter, isBefore, format, subDays, isSameDay } from 'date-fns'; |