Skip to content

Instantly share code, notes, and snippets.

View caffeinum's full-sized avatar
🐶
Coffee Driven Development

Aleksey Bykhun caffeinum

🐶
Coffee Driven Development
View GitHub Profile
@poolsar42
poolsar42 / Guide.md
Last active January 23, 2023 06:49
Uploading large folders to IPFS

Hiya!

Uploading gigantic folders and files to IPFS sometimes could be tricky! But we are going to make it. I tried to write complete instructions on how to do this. But feel free to ask if something isn't going according to plan. 😉

IPFS Desktop

  1. First thing we need to do is to install IPFS Desktop client. Follow the link and choose your option.
  2. Open your IPFS Desktop and wait a bit until it loads.
const { expect } = require("chai");
describe("NFTOptions", function () {
const penguAddr = "0xBd3531dA5CF5857e7CfAA92426877b022e612cf8";
const penguOwner = "0x2c2c2F6DBe08942280d4F7626b6BAd5C11D20215";
const ids = ["2036", "4205"];
const buyer = "0xe5ee2B9d5320f2D1492e16567F36b578372B3d9F";
const erc721Abi = [
"function approve(address to, uint256 tokenId)"
var Web3 = require('web3');
const EthereumTx = require('ethereumjs-tx');
const ethUtil = require('ethereumjs-util');
const rlp = require('rlp');
var txDecoder = require('ethereum-tx-decoder');
let flag = false;
let buffer;
const API_KEY = 'https://ropsten.infura.io/v3/YOUR_INFURA_KEY';
@Auronmatrix
Auronmatrix / recursive_check.sh
Last active November 27, 2018 10:35
BashScript to check all subfolders for compromised dependency (https://github.com/dominictarr/event-stream/issues/116)
#!/bin/bash
function recursiveCheck() {
for d in * ; do
if [ $d == "node_modules" ] ; then
#echo "Skipping $PWD"
else if [ -d "$d" ]; then
cd "$d"
#echo "Checking $PWD"
if [ -f "package.json" ];
@DavidBurkett
DavidBurkett / Genesis_Signer.py
Last active August 4, 2023 04:52
Create valid signatures using genesis block.
import math
import ecdsa
import ecdsa.ellipticcurve as EC
#
# Compute the inverse mod p using the extend
# euclidian algorithm.
# See O. Forster, Algorithmische Zahlentheorie
#
def inv_mod_p(x, p):
@sebmarkbage
sebmarkbage / Infrastructure.js
Last active May 2, 2024 03:11
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@holiman
holiman / Cloner.sol
Last active April 9, 2024 16:36
A generic 'cloner' contract which clones other contract instances
pragma solidity ^0.4.4;
contract X{
string junk;
function y() returns(string){
//Uncomment the 'junk' below to make gas-measurements
//junk="0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345