Skip to content

Instantly share code, notes, and snippets.


Losses Don Losses

View GitHub Profile
Losses / json.ts
Created November 16, 2022 06:13
Stream loading JSON and Stream saving JSON w/ `stream-json`
View json.ts
import fs from "fs";
import { Readable } from "stream";
import { stat, move, remove } from "fs-extra";
import Assembler from "stream-json/Assembler";
import { chain } from "stream-chain";
import { parser } from "stream-json";
import { stringer } from "stream-json/Stringer";
import { disassembler } from "stream-json/Disassembler";
View 8-bpp-bmp-decode.html
<canvas id="canvas"></canvas>
(async () => {
const response = await fetch('./0000.bmp');
const arraybuffer = await response.arrayBuffer();
const dataview = new DataView(arraybuffer);
const offset = dataview.getUint32(10, true);
const width = dataview.getUint32(18, true);
let height = dataview.getInt32(22, true);
Losses / Sorin.psm1
Created September 2, 2019 02:25
Yet another Pwsh theme config.
View Sorin.psm1
#requires -Version 2 -Modules posh-git
function Write-Theme {
Losses /
Created July 26, 2019 08:33 — forked from nikitametha/
Installing Caffe on Ubuntu 16.04 and above (CPU ONLY, WITHOUT CUDA OR GPU SUPPORT)

This is a guide on how to install Caffe for Ubuntu 16.04 and above, without GPU support (No CUDA required).



sudo apt-get install libopencv-dev python-opencv

OpenBLAS OR Atlas

import pymongo
from bson.json_util import dumps, RELAXED_JSON_OPTIONS
HOST = # Something like 'mongodb://localhost:23333'
DB = # What's the database of interest?
COLLECTION = # And the collection?
QUERY = # The query parameters, very similar to mongo in js, check out the ref below.
OUTPUT = # The json file will be written into which place?
# That's all you need to fill above.
Losses / stickers-downloader.js
Created April 16, 2018 22:59 — forked from lubien/stickers-downloader.js
Download all visible telegram stickers images
View stickers-downloader.js
// How to download telegram sticker images
1. Go to Telegram Web;
2. Open console (F12);
3. Paste the code below in the console and press Enter;
4. Open your stickers menu and make sure you see the sticker pack you want to download (so Telegram will load it).
5. At the console paste and run "downloadStickers()" any time you want to download a pack.
6. [Convert .webm to another format](;
7. Happy hacking.
View debug.jsx
// Provide custom regenerator runtime and core-js
// Javascript required hook
require('babel-register')({presets: ['es2015', 'react']})
// Image required hook
extensions: ['jpg', 'png', 'gif', 'webp'],
limit: 8000
View module.jsx
import React from 'react'
import { Link } from 'react-router-dom'
import fileLoader from 'file-loader'
class HeaderBar extends React.Component {
constructor(props) {
render() {