Today, John Tromp - creator of the Binary λ-Calculus, and one of the smartest functional wizards alive - ported his famous prime number generator (first published 12 years ago!) to HVM:
Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!
The advantages of versions 0.8.*
over <0.8.0
are:
- Safemath by default from
0.8.0
(can be more gas efficient than some library based safemath). - Low level inliner from
0.8.2
, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
https://www.nerdfonts.com/font-downloads
The following solution thanks to @hackerzgz & @snacky101 will install all nerd fonts;
brew tap homebrew/cask-fonts
brew search '/font-.*-nerd-font/' | awk '{ print $1 }' | xargs -I{} brew install --cask {} || true
Archived. Please see https://www.sainnhe.dev/post/status-line-config
First of all, install a nerd font, and apply it: nerd font
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/
in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/
.
At the end of the day, vendoring (and committing vendor/
) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
First, find the container that runs your MongoDB and ssh into it.
Then, find the collection you want to export:
mongo
show dbs
use <database>
show collections
exit
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: kube-registry-v0 | |
namespace: kube-system | |
labels: | |
k8s-app: kube-registry | |
version: v0 | |
spec: | |
replicas: 1 |
Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"
import sys | |
def getText(l): | |
l=l.replace('\\citep','') | |
l=l.replace('\\cite','') | |
return l | |
with open(sys.argv[1],'rb') as f : ls = f.readlines() | |
empty=False |
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
su_exec = pkgs.stdenv.mkDerivation { | |
name = "su-exec-0.2"; | |
src = fetchurl { | |
url = https://github.com/ncopa/su-exec/archive/v0.2.tar.gz; | |
sha256 = "09ayhm4w7ahvwk6wpjimvgv8lx89qx31znkywqmypkp6rpccnjpc"; |