Skip to content

Instantly share code, notes, and snippets.

View G-Ray's full-sized avatar

Geoffrey Bonneville G-Ray

View GitHub Profile
@robin-hartmann
robin-hartmann / bundler.js
Last active January 3, 2024 08:00
npm workspaces support for electron-forge
// based on https://github.com/electron-userland/electron-forge/issues/2306#issuecomment-1034882039
'use strict';
/**
* @typedef {{
* new (options: { path: string }): {
* loadActual(): Promise<Node>
* }
* }} Arborist
*/
@ckerr
ckerr / bittorrent-client-tests.md
Created September 20, 2019 22:21
BitTorrent Client Performance Tests

BitTorrent Client Performance Tests

Performance Constrained by Low-Speed 300 KB/s Down, 39 KB/s Up ADSL Provisioning

Benchmarks conducted 18-19, 22-24, 26-28 February; 01-07, 15-22 March 2010

BitTorrent Client Time to Download ubuntu-9.10-desktop i386.iso Memory Use While Downloading User CPU (MM:SS) Sys CPU (MM:SS) Engine GUI
BitTornado 0.3.18 1st run 53:33 19.3 MiB 2:15 0:53 Built-in Curses
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@gaearon
gaearon / MyResponsiveComponent.js
Created November 1, 2018 10:05
Examples from "Making Sense of React Hooks"
function MyResponsiveComponent() {
const width = useWindowWidth(); // Our custom Hook
return (
<p>Window width is {width}</p>
);
}
@zakne
zakne / gist:06618f0af3ddd490df6e8701f0c402c9
Last active January 16, 2018 04:03
GSoC vp9 decoder improvements report
During GSoC I was able to accomplish the following: optimize part of the ipred functions and implement tile threading support.
Links for optimized avx2 ipred functions:
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=35a5d9715dd82fd00f1d1401ec6be2d3e2eea81c
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=81fc617c125734aa6f3b3d938af75fef6db750e7
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=73d9a9a6af5d00cfa9b98c7d9fc9abd0c734ba8e
Links for the tile threading code:
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-August/215363.html
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-August/215361.html
@creationix
creationix / idb-dat-storage.js
Created August 8, 2017 22:40
A simple abstract-random-access implementation using indexed DB that takes advantage of hypercore's behavior or consistent boundaries/offsets.
/* eslint-env browser */
var Buffer = require('buffer').Buffer
var name = 'dat'
function withStore (type, block, callback) {
var req = indexedDB.open(name + '-db', 1)
req.onerror = () => callback(req.error)
req.onupgradeneeded = () => req.result.createObjectStore(name)
req.onsuccess = () => {

Can we create a smart contract VM on nodejs using Dat?

Ethereum is a trustless network of VMs which run smart contracts submitted by users. It uses proof-of-work to synchronize state across the network, and has every node execute the contracts in order to verify the state's validity. Each transaction is stored in the blockchain for replayability. Read more about it here.

Ethereum's "trustless network" model has some disadvantages:

  • Transaction processing is slow - it maxes at roughly 25tx/s right now for all contracts combined.
  • Every transaction costs money to execute.
  • The entire blockchain state must be shared across the computing network.
  • No private transactions.
@konfou
konfou / mkvextract-helper.sh
Last active March 3, 2024 15:29
extract all tracks/attachments/chapters from an mkv file
#!/usr/bin/env bash
#
# Extract all tracks/attachments/chapters from an mkv file.
# depends
type -p mkvmerge &>/dev/null || exit 3
type -p mkvextract &>/dev/null || exit 3
# trap SIGINT
trap 'trap - INT; kill -s INT "$$"' INT
@Brainiarc7
Brainiarc7 / skylake-tuning-linux.md
Last active March 30, 2024 16:01
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;