Skip to content

Instantly share code, notes, and snippets.

View kaloyan-raev's full-sized avatar

Kaloyan Raev kaloyan-raev

View GitHub Profile
@kaloyan-raev
kaloyan-raev / main.go
Created May 4, 2023 12:15
Migration tool from IPFS pinning provider to Storj IPFS.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
@kaloyan-raev
kaloyan-raev / main.go
Last active June 22, 2022 13:36
Minimal code for calculating IPFS CID
package main
import (
"fmt"
"io"
"os"
"sync"
cid "github.com/ipfs/go-cid"
chunker "github.com/ipfs/go-ipfs-chunker"
@kaloyan-raev
kaloyan-raev / main.go
Last active July 18, 2019 16:03
Encryption Access from Encryption Key for Storj V3
package main
import (
"context"
"fmt"
"storj.io/storj/lib/uplink"
)
const (
@kaloyan-raev
kaloyan-raev / main.go
Created April 17, 2019 09:30
Example program in Go using Storj libuplink.
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package main
import (
"bytes"
"context"
"fmt"
"io/ioutil"

Keybase proof

I hereby claim:

  • I am kaloyan-raev on github.
  • I am kaloyan (https://keybase.io/kaloyan) on keybase.
  • I have a public key ASBAhWjeY-QE4sNrC6yJ-FvxT8l06_uNpt6oS0ZSeMaQ_Ao

To claim this, I am signing this object:

@kaloyan-raev
kaloyan-raev / che
Last active October 31, 2016 07:26
Eclipse Che service script for AWS
#! /bin/sh
### BEGIN INIT INFO
# Provides: che
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Eclipse Che
# Description: Starts and stops Eclipse Che
#
xmlDiff.overrideDifferenceListener(
new IgnoreVariableAttributesDifferenceListener());
FileReader xml1 = ...
FileReader xml2 = ...
Diff xmlDiff = new Diff(xml1, xml2);
xmlDiff.similar();
public class IgnoreVariableAttributesDifferenceListener implements
DifferenceListener {
private static final List<String> IGNORE_ATTRS = Arrays
.asList(new String[] { "version", "download-size", "install-size" });
@Override
public int differenceFound(Difference difference) {
if (isIgnoredAttributeDifference(difference)) {
return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;