Skip to content

Instantly share code, notes, and snippets.

View developerfred's full-sized avatar
🥇
🔥

codingsh developerfred

🥇
🔥
View GitHub Profile
Verifying my Blockstack ID is secured with the address 1yJVpBi9EW9sY5ygYTbyyaqQChKQ4WCXr https://explorer.blockstack.org/address/1yJVpBi9EW9sY5ygYTbyyaqQChKQ4WCXr
@developerfred
developerfred / ipfs-guide-mac.md
Created November 5, 2019 19:06 — forked from tgerring/ipfs-guide-mac.md
IPFS Mac Guide

IPFS Guide

Mac Installation

  1. Install Homebrew
  2. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Install prerequisites
  4. brew install git hg
  5. brew install osxfuse (see Mac issues to troubleshoot common errors)
  6. Install Go
@developerfred
developerfred / RangeandMaps.go
Last active November 10, 2019 16:23
Go BootCamp
package main
import (
"fmt"
)
func main() {
cities := map[string]int{
"New York": 8336697,
"Los Angeles": 3857799,
@developerfred
developerfred / println.rs
Created November 11, 2019 01:15
Learning Rust Codes
fn main() {
let x = 5;
let y = 10;
println!("x = {} and y = {}", x, y);
}
@developerfred
developerfred / .bashrc
Created November 13, 2019 05:49 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@developerfred
developerfred / rust_nightly.rb
Created November 14, 2019 01:30 — forked from gcv/rust_nightly.rb
Homebrew formula for installing the official Rust nightly binary build. Useful because: (1) the `rust.rb` formula in Homebrew does not currently install Crate, and (2) the official binary `.pkg` pollutes `/usr/local`. This formula respects Homebrew's installation directory.
class RustNightly < Formula
url "https://static.rust-lang.org/dist/rust-nightly-x86_64-apple-darwin.pkg", using: :nounzip
homepage "http://www.rust-lang.org"
sha1 ""
version Date.today.to_s
def install
system "pkgutil --expand rust-nightly-x86_64-apple-darwin.pkg rn"
=== npm audit security report ===
# Run npm install --save-dev karma@4.4.1 to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ braces │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ karma [dev] │
@developerfred
developerfred / go-stdlib-interface-selected.md
Created November 20, 2019 20:01 — forked from asukakenji/go-stdlib-interface-selected.md
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@developerfred
developerfred / go-table-driven-tests-parallel.md
Created November 21, 2019 03:21 — forked from posener/go-table-driven-tests-parallel.md
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@developerfred
developerfred / substrate-knownledge-dump.md
Created November 22, 2019 04:42 — forked from jordy25519/substrate-knownledge-dump.md
Substrate/Plug/CENNZnet Knowledge Dump

Rust

cargo check

Sometimes errors from macro expansion are too opaque to debug. To see errors with the expanded macro set RUSTFLAGS like so:

RUSTFLAGS="-Z external-macro-backtrace" cargo +nightly [test|check]