Skip to content

Instantly share code, notes, and snippets.

Avatar

Mikola Lysenko mikolalysenko

View GitHub Profile
View analyze-security.js
const fs = require('fs');
const path = require('path');
const ticker = 'gme';
const re = new RegExp(`${ticker.toUpperCase()}\\s+,\\s*(\\d+\\.?\\d*)\\s*,\\s*(\\d+\\.?\\d*)\\s*,\\s*`);
console.log('Date,Market Loan-Loan Balance,Hedge-Loan Balance,');
(async () => {
View gme-loan.csv
Date Market Loan-Loan Balance Hedge-Loan Balance
4/1/2021 6300000.00 521949429.00
5/1/2021 6300000.00 543554502.00
6/1/2021 5846300.00 580727376.00
7/1/2021 8143400.00 574553466.00
8/1/2021 9093400.00 580071211.00
11/1/2021 13755000.00 627710704.00
12/1/2021 13755000.00 661710954.00
13/1/2021 21615000.00 1075260407.00
14/1/2021 26900100.00 1350479619.00
@mikolalysenko
mikolalysenko / scrape-occ.js
Created Jul 16, 2021
scrapes loan data from occ
View scrape-occ.js
const fetch = require('node-fetch');
const fs = require('fs');
const startDate = new Date(2021, 0);
const endDate = new Date();
const msPerDay = 86400000;
const fetchDelayMS = 1000;
function pad(s, d) {
while (s.length < d) {
View yahoo_gme_weird_volume_packet.json
{
"chart": {
"result": [
{
"meta": {
"currency": "USD",
"symbol": "GME",
"exchangeName": "NYQ",
"instrumentType": "EQUITY",
"firstTradeDate": 1013610600,
View vox-to-box.js
// install:
//
// npm install ndarray parse-magica-voxel
//
// usage:
//
// node vox-to-box.js my-file.vox > my-file.terrain
//
const parseMagicaVoxel = require('parse-magica-voxel')
View strawman-api.js
const HelNumber = require('helschema/number')
const HelString = require('helschema/string')
const HelStruct = require('helschema/struct')
const HelDictionary = require('helschema/dictionary')
const EntitySchema = HelStruct({
x: HelNumber,
y: HelNumber,
color: HelString
})
View gl-toaster.js
const regl = require('regl')()
const video = document.createElement('video')
video.src = 'mario.mp4'
video.currentTime = window.localStorage.getItem('currentTime') | 0
function persistVideoLocation () {
window.localStorage.setItem('currentTime', video.currentTime)
}
View regl-multiply-blend.js
const regl = require('regl')()
const drawCircle = regl({
attributes: {
p: [0] // dummy attribute
},
frag: `
precision highp float;
uniform vec3 color;
View blendMode.js
{
blend: {
enable: true,
func: {
src: 'dst color',
dst: 'one minus src alpha'
},
equation: 'add'
}
}