Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Huned Botee huned

💭
I may be slow to respond.
View GitHub Profile
@huned
huned / pdf2json.js
Created May 11, 2020
Convert a PDF to JSON with pdf.js.
View pdf2json.js
const fs = require('fs')
const pdfjs = require('pdfjs-dist')
const readPdf = async filename => {
const buf = await fs.promises.readFile(filename)
const doc = await pdfjs.getDocument(buf).promise
const docBlob = {
metadata: null,
pages: []
}
View simple_moving_average.js
Array.prototype.simple_moving_average = function(window_length) {
var averaged = new Array(this.length);
var chunk = [];
for (k = 0; k < this.length; k++) {
chunk.push(this[k]);
if (chunk.length > window_length) chunk.shift();
averaged[k] = chunk.sum() / chunk.length; // sum() is an exercise left to the reader
}
return averaged;
};
@huned
huned / window.sh
Created May 25, 2021
Command-line utility to position windows
View window.sh
#!/bin/bash
set -x
dim=$(wmctrl -d | head -n 1 | grep -Eho '[0-9]{4}x[0-9]{3,4}' | tail -n 1)
width=$(echo $dim | cut -d x -f 1)
#height=$(echo $dim | cut -d x -f 2)
height=2130
margin=0
maxWidth=$(( $width - 2*$margin ))
halfWidth=$(( $width/2 - 2*$margin ))
@huned
huned / russell_3000_2011-06-27.csv
Created May 11, 2012
Ticker symbols for all the companies in the Russell 3000 Index as of 2011-06-27
View russell_3000_2011-06-27.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
A
ACO
AA
ACOM
AAN
ACOR
AAON
ACPW
AAP
ACTG
@huned
huned / eos-post-install.sh
Created Feb 18, 2021 — forked from diniremix/eos-post-install.sh
elementaryOS post install
View eos-post-install.sh
# elementary OS Juno post install
# first step, upgrade
sudo apt update && sudo apt upgrade
sudo apt install ubuntu-restricted-extras
sudo apt install software-properties-common --no-install-recommends
sudo apt install libavcodec-extra ffmpeg
sudo apt install firefox vlc
sudo apt install screenfetch flameshot
@huned
huned / us_federal_holidays.json
Last active Feb 18, 2021
US Federal Holidays 2021-2031
View us_federal_holidays.json
{
"2029-05-28" : {
"name" : "Memorial Day",
"date" : "May 28, 2029"
},
"2025-12-25" : {
"name" : "Christmas Day",
"date" : "December 25, 2025"
},
"2021-01-01" : {
@huned
huned / id_rsa.pub
Created May 29, 2020
huned@qux public key
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDayMWjaM7shFjoC1YL1uG0d0Xi7xRnq/Jhm5QEAcx0umm/bRp8vyIDIypCXS1wPXXmeopByZwhqSpESgC/xkAoTQOAscGEDbHdlcQx2MUQ1jV8icIN9MgehqWrEA7jAQMqPl90Ck0U31M8wYyMZ1GM/c7R6VZi5lG+H3AmiWIX758DC9RXkyP6DaS2+UKQCUpg5OY6o0mqFe+rGla/TvfMDxP27u5Kpfw4SxbLQDNAGxtftpNaOgVAIpkPFt+/YkyJm6tJS8VaWRjXWhgNR5th+vntJUDx8IRrm5IBVWQxbQIg/YgATluGg1r3eGp3VAURkTR8J7ZPzBRK4tLRANn3tRszXDFmPAdyEnz9GgeKVSeJd1vCXipUm6jdqAbZAutYyIY7b/Upq4uUwlUGCX8aJYS//FlTVfV2XencmWFFpxh31SUuCKzkhtMJeiizz+NXkIC2RXPYh8w6I+JW0eSxpwtRRZjJ723SauNrFupGX8ZzKauDZo+e+5smbydzksIMmCk4SOlFVkXuQxNusfqovRcJrHI9HXKIaDd1mzBX017FrZW5CaaKe96glRwAN3jpzARuJBuJNcB/Pkpgns9pbOkknFl93614uN8Nq9llWylhtClG+NLisYsBhfN+TE9+53nlABMOrcaihbcc/PGB4NcXmD1j4lqifBU5eHpRHw== huned@omg
@huned
huned / ladder.md
Last active May 5, 2020 — forked from jamtur01/ladder.md
[PROPOSAL] ZeroCater Engineering Ladder
@huned
huned / survey_dsl.rb
Created Nov 1, 2010
a survey DSL as valid ruby syntax
View survey_dsl.rb
include Survey::DSL
survey 'Finances Questionnaire' do
q "Do you have a Durable Power of Attorney for Finances?" do
yes do
a "Who is the designated agent for handling your finances?" do
field 'Full Name'
phone 'Phone Number'
email 'Email'
View -
Elna O'Kon
Heber Deckow
Wilbert Kozey
Trevor Rohan
Raquel Marvin
Vance Gerlach
Chaz Hirthe
Stefan Thiel
Marcus Ratke
Mr. Marisol Simonis