Skip to content

Instantly share code, notes, and snippets.

@supersuryaansh
supersuryaansh / hypercore-read.mjs
Created May 12, 2025 04:29
Write and read hypercore records
import Hypercore from 'hypercore'
const core = new Hypercore('./directory', {valueEncoding: 'utf-8'})
await core.ready()
for (let x = 1; x <=10000; x++) {
await core.append(`${x}`)
}
const fullStream = core.createReadStream({ start: 9900, end: 9910})
  • Please note we accept contributions to this repository under the MIT License. It means when a contributor submits a pull request, the pull request code is licensed under the MIT license.

  • The MIT License is a permissive Open Source software license from the Massachusetts Institute of Technology (MIT). You can read more about the MIT license from here: https://en.wikipedia.org/wiki/MIT_License and the MIT license can be accessed here: https://opensource.org/license/MIT

  • The MIT license requires including a copy of the terms of the MIT License and also a copyright notice. This is provided below.

Copyright 2025 Liveport P2P Solutions Pvt. Ltd.

@supersuryaansh
supersuryaansh / full-width-second-button.js
Last active July 26, 2024 06:19
Add second button to Divi Full Width Slider.js
<script>
window.onload = function() {
// Code to duplicate the button
const elementToDuplicate = document.querySelector('.et_pb_button.et_pb_more_button');
// Clone the element
const clonedElement = elementToDuplicate.cloneNode(true);
// Update the URL of the cloned element
clonedElement.href = 'https://example.com/#newurl';
@supersuryaansh
supersuryaansh / statusCode.c
Last active December 26, 2023 16:07
Return status code of a webpage in C using CURL
// requires #include <curl/curl.h>
int statusCode(char *addr){
CURL *curl;
CURLcode res;
long response_code;
// Initialize curl
curl_global_init(CURL_GLOBAL_DEFAULT);