Skip to content

Instantly share code, notes, and snippets.

@eddmann
eddmann / bitcoin-merkle-proofs.js
Created November 10, 2017 10:20
Bitcoin Internals: Verifying Merkle Roots using Merkle Proofs in JavaScript
const fetchLatestBlock = () =>
fetch(`https://blockchain.info/q/latesthash?cors=true`)
.then(r => r.text());
const fetchMerkleRootAndTransactions = block =>
fetch(`https://blockchain.info/rawblock/${block}?cors=true`)
.then(r => r.json())
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]);
const random = arr =>
@edh62
edh62 / hello.c
Last active May 11, 2024 05:07
prg C
int main()
{
print("Hello worlp");
return 0;
}
@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

@matt-dray
matt-dray / mutate-if-any.R
Created January 19, 2022 09:52
Pattern for `mutate()` with `if_any()` using {dplyr}
# Goal: put 1 in new col where 1 appears across other cols
library(dplyr)
df <- tibble(
x1 = c(1, NA, NA),
x2 = c(NA, 1, NA),
x3 = c(NA, 1, NA)
)
@YouDevs
YouDevs / post.blade.php
Last active May 11, 2024 04:59
Curso Laravel - Proyecto blog - Listado de categorías - vistas
<!-- agrega aquí el header con el logo -->
<!-- Contenido -->
<section class="container-fluid content py-5">
<div class="row justify-content-center">
<!-- Post -->
<div class="col-12 col-md-7 text-center">
<h1>POO con Javascript, feo pero posible</h1>
<hr>
<img src="images/8.png" alt="Post Javascript" class="img-fluid">
@hibiyasleep
hibiyasleep / GodDrinksJava.java
Last active May 11, 2024 04:53
world.execute(me);
package goddrinksjava;
/**
* The program GodDrinksJava implements an application that
* creates an empty simulated world with no meaning or purpose.
*
* @author momocashew
* @lyrics hibiyasleep
*/
@mikepruett3
mikepruett3 / shell-setup.ps1
Last active May 11, 2024 04:45
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
const crypto = require('crypto');
// this usually takes a few seconds
function work(limit = 100000) {
let start = Date.now();
n = 0;
while(n < limit) {
crypto.randomBytes(2048);
n++;
}