Skip to content

Instantly share code, notes, and snippets.

View Losses's full-sized avatar
🇺🇦
Peace

Losses Don Losses

🇺🇦
Peace
  • RORIRI's DATA CENTER
  • VOID CITY
View GitHub Profile
@Losses
Losses / json.ts
Created November 16, 2022 06:13
Stream loading JSON and Stream saving JSON w/ `stream-json`
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";
<canvas id="canvas"></canvas>
<script>
(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
Losses / Sorin.psm1
Created September 2, 2019 02:25
Yet another Pwsh theme config.
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
@Losses
Losses / installing_caffe.md
Created July 26, 2019 08:33 — forked from nikitametha/installing_caffe.md
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).

Prerequisites:

OpenCV

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
Losses / stickers-downloader.js
Created April 16, 2018 22:59 — forked from lubien/stickers-downloader.js
Download all visible telegram stickers images
// 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](http://www.freewaregenius.com/convert-webp-image-format-jpg-png-format/);
7. Happy hacking.
// Provide custom regenerator runtime and core-js
require('babel-polyfill')
// Javascript required hook
require('babel-register')({presets: ['es2015', 'react']})
// Image required hook
require('asset-require-hook')({
extensions: ['jpg', 'png', 'gif', 'webp'],
limit: 8000
import React from 'react'
import { Link } from 'react-router-dom'
import fileLoader from 'file-loader'
class HeaderBar extends React.Component {
constructor(props) {
super(props)
}
render() {