Skip to content

Instantly share code, notes, and snippets.

View rusintez's full-sized avatar
💭
🍝

vlspopov rusintez

💭
🍝
View GitHub Profile
@digitaltembo
digitaltembo / minimalWsServer.ts
Last active March 17, 2024 13:31
Minimal WebSocket Server in NodeJS/TypeScript, no dependencies
import { createHash } from "crypto";
import { createServer, IncomingMessage } from "http";
import { Duplex } from "stream";
type WsFn = (val: string | Uint8Array) => void;
// Create this object whenever a websocket connection has been established
type WebSocket = {
write: WsFn;
addListener: (listener: WsFn) => void;
@br3ndonland
br3ndonland / github-actions-notes.md
Last active April 21, 2024 04:25
Getting the Gist of GitHub Actions
@maitrungduc1410
maitrungduc1410 / create-vod-hls.sh
Last active March 1, 2024 22:29
Bash scripts to create VOD HLS stream with ffmpeg (Extended version)
#!/usr/bin/env bash
START_TIME=$SECONDS
set -e
echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
@Disturbing
Disturbing / kinto-compose-proposal.md
Last active April 1, 2020 04:12
Kinto Compose Proposal

KintoCompose Proposal

One of the earliest goals of Kinto team was to make every Git repository deployable to the cloud and compatible with any other repository. KintoCompose will aim to do this as an open source initiative.

  • Kinto is inspired by the kinto'un which is the magic cloud that Son Goku rides in Dragon Ball Z, or Wu Kong in the journey to the west.
  • Compose inspired by docker-compose and go modules through combining git repositories and their configuration to be served into any cloud via kubernetes.

KintoCompose Goals

  • Serve any Git repository into a public and private endpoint with ease.
@jsoverson
jsoverson / intercept.js
Created February 19, 2019 21:28
Intercept responses with chrome and puppeteer
const puppeteer = require('puppeteer');
const prettier = require('prettier');
const atob = require('atob');
const btoa = require('btoa');
const scriptUrlPatterns = [
'*'
]
const requestCache = new Map();
@dmshvetsov
dmshvetsov / worker_and_queue_perfect_pair.rb
Created February 5, 2019 05:33
Example of how we may use queue with threads to make efficient background worker.
class Worker
def self.start(num_threads:, queue_size:)
queue = SizedQueue.new(queue_size)
worker = new(num_threads: num_threads, queue: queue)
worker.spawn_threads
worker
end
def initialize(num_threads:, queue:)
@num_threads = num_threads

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@bradharms
bradharms / fs-xml-http-request.js
Last active September 23, 2019 04:17
An XMLHttpRequest-compatible interface to Node's "fs" module.
import fs from 'fs';
let WindowXMLHttpRequest = null;
/**
* An XMLHttpRequest-compatible interface to Node's "fs" module.
*/
class FSXHR {
constructor() {
/**
@pyk
pyk / graceful_shutdown_while_loop.py
Created January 19, 2018 17:27
Graceful shutdown in Python While Loop
import time
import signal
def busy_work(seconds):
print("Start busy_work")
time.sleep(seconds)
print("Stop busy_work")
@ruthmarks151
ruthmarks151 / gitprint.js
Last active December 14, 2018 06:39 — forked from beevelop/gitprint.js
Print GitHub markdown files
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white');
document.querySelector('body').appendChild(document.querySelector('#readme'));
document.querySelector('article').style.borderWidth = 0;
window.print();