Skip to content

Instantly share code, notes, and snippets.

View 86me's full-sized avatar
🎯
Focusing

Egon Hyszczak 86me

🎯
Focusing
View GitHub Profile
@vasa-develop
vasa-develop / index.html
Last active October 6, 2019 04:32
SimpleAsWater: Host a website using IPFS, IPNS and DNSLink
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello IPFS!</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<h1>Hello IPFS!</h1>
<span>Hosting on IPFS is SimpleAsWater</span>
// Report on "stuck" ether in empty contracts
// https://github.com/ethereum/EIPs/issues/156
// Usage: node find-stuck-ether.js [startBlock] [endBlock] > report.txt
let Eth = require('ethjs');
let eth = new Eth(new Eth.HttpProvider('http://localhost:8545'));
let ethutil = require('ethereumjs-util')
async function main() {
@cvan
cvan / set-up-chromium-keys.md
Last active June 14, 2024 14:29
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!

@huytd
huytd / co-in-15-lines.js
Last active May 25, 2016 10:10
Re-implement tj/co in 15 lines
function run(fn) {
var pointer = fn();
var next = function(result) {
if (result.value.then && typeof result.value.then === 'function') {
result.value.then(function(data) {
var out = pointer.next(data);
if (!out.done) next(out);
});
} else {
var out = pointer.next(result.value);
@yash1610
yash1610 / aur_auto_update.sh
Last active March 11, 2016 06:24
Bash script to auto update installed aur packages
#!/bin/bash
green='\E[32m'
bold='\033[1m'
normal='\033[0m'
#Create a directory and cd into it
echo -e "\n$bold$green"Creating a temp directory to work in..."$normal\n"
TEMPDIR=$(mktemp -d)
pushd $TEMPDIR
echo -e "\n$bold$green"Working in $TEMPDIR"$normal\n"
@ethers
ethers / call-then-sendtx-pattern.js
Last active July 24, 2020 05:51
call-then-sendtx pattern for Ethereum Dapps
/*
In Ethereum, a contract can be written so that it returns a value for eth_call.
A Dapp can then check for success or error value of eth_call, before calling eth_sendTransaction,
to take advantage of eth_call effectively being a "preview" of the code flow that the transaction
will take. In traditional client-server, clients can't ask servers beforehand what's going to
happen when the client makes a call; with Dapps contracts can be written so that clients can ask
for a "preview" of what is going to happen, before any funds/ethers are actually utilized
(eth_call does not cost any ethers).
Note: it is possible that in between eth_call and when eth_sendTransaction is actually mined,
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@dutc
dutc / Makefile
Last active September 27, 2023 04:40
function hooking in C
.PHONY: hook
CC=gcc -std=c99 -Wall
hook: hook-main hook-preload.so
./hook-main
LD_PRELOAD=./hook-preload.so ./hook-main
hook-main: hook-main.c
${CC} -O0 -Wl,--export-dynamic -g -ggdb -o $@ $^ -ldl
@amatiasq
amatiasq / curry.js
Last active March 15, 2019 10:34
Simple way to recursively curry javascript functions http://jsfiddle.net/amatiasq/osrsomq0/
/**
* @param {Function} fn Function to curry.
* @param {Number} lenght The arguments required to invoke the function. Optional. By default is fn.length
* @returns {Function} The currified function.
*/
function curry(fn, length) {
length = length || fn.length;
return function currified() {
var args = [].slice.call(arguments);
/* patchbin.c, Patch a binary file, by Lionello Lunesu, placed in the public domain */
struct FILE;
extern struct FILE* fopen(char*, char*);
extern int fwrite(void*, int, int, struct FILE*);
extern int fread(void*, int, int, struct FILE*);
extern int fseek(struct FILE*, long int, int);
#define SEEK_SET 0
extern int memcmp(void*, void*, int);
int main(int argc, char** argv)