I hereby claim:
- I am follgad on github.
- I am emilahlback (https://keybase.io/emilahlback) on keybase.
- I have a public key ASDC9Qg9zzarwY7QWmaAohK6AI4IC_hOBdyk_cKM9BgtPAo
To claim this, I am signing this object:
| ### Keybase proof | |
| I hereby claim: | |
| * I am follgad on github. | |
| * I am emilahlback (https://keybase.io/emilahlback) on keybase. | |
| * I have a public key ASBxx4TSjZozItRhSyOD_ceH8PGPmQOG2g7GDDEUg8qVkgo | |
| To claim this, I am signing this object: |
| const fs = require('fs'), | |
| crypto = require('crypto') | |
| function getHash(pathToFile) { | |
| let readSize = 64 * 1024 // 64kb | |
| return new Promise((resolve, reject) => { | |
| let fd = fs.openSync(pathToFile, 'r') | |
| let buffer = new Buffer(readSize * 2) |
I hereby claim:
To claim this, I am signing this object:
| let fs = require('fs'), | |
| PNG = require('pngjs').PNG; | |
| fs.createReadStream('./dino_design20by20.png') | |
| .pipe(new PNG({ | |
| filterType: 4 | |
| })) | |
| .on('parsed', function () { | |
| let arr = [] | |
| for (let y = 0; y < this.height; y++) { |
| // This is written for Deno, not node.js | |
| import { readJson } from "https://deno.land/std@0.63.0/fs/read_json.ts" | |
| /* | |
| A script I wrote to parse the data you can download from WakaTime, to display how many hours you spent working on specific | |
| projects. | |
| */ | |
| interface Duration { |
| // get the stat count from planetminecraft.com | |
| const cheerio = require("cheerio") | |
| const fetch = require("node-fetch") | |
| const fs = require("fs") | |
| const getTheStat = () => { | |
| fetch("https://www.planetminecraft.com/resources/servers/") | |
| .then(res => res.text()) | |
| .then(html => { | |
| let planet = cheerio.load(html), |
| sudo apt update && sudo apt upgrade | |
| sudo apt -y install mpv | |
| sudo apt -y install git | |
| sudo apt -y install syncthing | |
| sudo apt -y install transmission-daemon | |
| sudo apt -y install firefox | |
| sudo add-apt-repository ppa:neovim-ppa/unstable | |
| sudo apt -y install neovim | |
| sudo apt -y install fd-find |
| const diffInYears = (older, recent) => | |
| (recent.getTime() - older.getTime()) | |
| / 1000 / 60 / 60 / 24 / 365.25 | |
| const myAge = diffInYears(new Date("1999-08-17T04:21:05+02:00"), new Date()) |
| import React, { FC } from "react"; | |
| import Editor from "rich-markdown-editor"; | |
| const uploadFile = async (file: File): Promise<string> => { | |
| // Upload file here, returning the new URL to the file | |
| }; | |
| export const RichEditorWithFileUpload: FC = () => { | |
| return ( | |
| <Editor |
| // translates dynamic-length hamming codes into raw data | |
| function hamming(n) { | |
| const s = n.length | |
| let o = "" | |
| let errors = [] | |
| for (let i = 1; i < s; i++) { | |
| const pw2 = !( i & (i - 1) ) // is power of two | |
| if (!pw2) { | |
| o += n[i] | |
| } else { |