Skip to content

Instantly share code, notes, and snippets.

View nonsense's full-sized avatar
❄️

Anton Evangelatov nonsense

❄️
View GitHub Profile
@gbalint
gbalint / special_swarm_requests.md
Last active October 27, 2018 13:53
How to implement special (hash/list/immutable/raw) request types in swarm

We need a few special type of requests for testing/debugging purposes on swarm:

  • raw: returns the raw content at the given hash
  • hash: returns the hash and not the content
  • list: returns the list of all the files in the manifest under the given path
  • immutable: skip ENS resolving, only accept hashes

We have different kind of possible solutions on how to differentiate the requests to implement these special request types. These potential solutions all have their pros and cons.

Possible solutions

import sys
import numpy as np
import matplotlib.pyplot as plt
import theano
import theano.tensor as T
rs = np.random.RandomState(1234)
def gen_spiral(label, dt, n_samples=100, noise=0.1):
"""
@h12w
h12w / goclean.sh
Last active August 24, 2021 03:13
golcean.sh does automatic checking on a Go package and its sub-packages.
#!/bin/bash
# The script does automatic checking on a Go package and its sub-packages, including:
# 1. gofmt (http://golang.org/cmd/gofmt/)
# 2. goimports (https://github.com/bradfitz/goimports)
# 3. golint (https://github.com/golang/lint)
# 4. go vet (http://golang.org/cmd/vet)
# 5. race detector (http://blog.golang.org/race-detector)
# 6. test coverage (http://blog.golang.org/cover)
set -e
@cameron
cameron / init.sh
Last active August 1, 2017 12:57
initialize a CoreOS vm with the latest docker and DNS service discovery via skydock
This gist is old. Check out http://gijs.github.io/blog/2014/09/09/docker-and-service-discovery/
@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
FROM ubuntu:12.04
MAINTAINER Nicolas BERNARD <nikkau@nikkau.net>
# Ruby
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
RUN echo deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu precise main > /etc/apt/sources.list.d/brightbox.list
# NodeJS (Assets pipeline)
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7917B12
RUN echo deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu precise main > /etc/apt/sources.list.d/nodejs.list
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@itsderek23
itsderek23 / Dockerfile
Created August 27, 2013 02:09
Example Docker File to start a Rails app located in a local ./docker-rails directory.
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY
@akitaonrails
akitaonrails / patch_ruby_2.0.0_net_http
Created April 23, 2013 22:14
Problem with omniauth returns not gunziping the raw_info data
module AllowGzipInflating
def initialize(m, reqbody, resbody, uri_or_path, initheader = nil)
super
@header["accept-encoding"] = [] if @decode_content
end
end
class Net::HTTPGenericRequest
prepend AllowGzipInflating
end