This gist provides guidence to publish release using goreleaser for OSS golang projects that either not offer desired packages by any means or not release as frequent as desired.
- Fork the golang repo to your own repository
- Clone the repo
This gist provides guidence to publish release using goreleaser for OSS golang projects that either not offer desired packages by any means or not release as frequent as desired.
| #!/bin/bash | |
| VERSION=$1 | |
| sudo apt update | |
| sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev | |
| curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz | |
| tar -xf Python-$VERSION.tar.xz | |
| cd Python-$VERSION |
I hereby claim:
To claim this, I am signing this object:
| import bs4 | |
| import re | |
| import urllib.request | |
| def getFullHtml(url: str) -> str: | |
| """Retrieve the html content of the given url.""" | |
| return urllib.request.urlopen(url).read().decode('utf-8') | |
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| var ( | |
| // Web is the web search engine |
| import bisect | |
| import hashlib | |
| def my_hash(key): | |
| '''Return a hash in the range [0,1).''' | |
| return (int(hashlib.md5(key.encode('utf-8')).hexdigest(), 16) % 1000000) / 1000000 | |
| class ConsistentHashing: |
| public class LargeFileReader { | |
| private static final long PAGE_SIZE = Integer.MAX_VALUE; | |
| private List<MappedByteBuffer> buffers = new ArrayList<>(); | |
| private final byte raw[] = new byte[1]; | |
| LargeFileReader(FileChannel channel) throws IOException { | |
| long start = 0, length = 0; | |
| for (long index = 0; start + length < channel.size(); index++) { | |
| length = channel.size() / PAGE_SIZE == index ? channel.size() - index * PAGE_SIZE : PAGE_SIZE; | |
| start = index * PAGE_SIZE; |
| class FenwickTree: | |
| def __init__(self, nums): | |
| self.lowbit = lambda x: x & (-x) | |
| self.vals = [0] * (len(nums)+1) | |
| for i, v in enumerate(nums, 1): | |
| self.update(i, v) | |
| def update(self, i, val): | |
| while i < len(self.vals): | |
| self.vals[i] += val |
| """ | |
| To count up for a global variable. | |
| """ | |
| from threading import Thread, Lock | |
| var = 0 | |
| lock = Lock() | |
| class IncrementThread(Thread): | |
| def run(self): |
| const { Worker } = require('webworker-threads'); | |
| const app = require('express')(); | |
| app.get('/', (req, res) => { | |
| const worker = new Worker(function() { | |
| this.onmessage = function() { | |
| let cnt = 0; | |
| while (cnt < 1e9) { | |
| cnt++; | |
| } |