By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
package main | |
import ( | |
"fmt" | |
) | |
// This is a demonstration of embedding struct and overriding | |
// a method of parent struct. | |
// https://go.dev/play/p/nIdwUV8Qlaj |
#!/bin/bash | |
sudo su | |
apt update | |
apt -y install wget zip build-essential | |
# Install Go 1.19.4 | |
wget https://go.dev/dl/go1.19.4.linux-amd64.tar.gz | |
tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz | |
exit |
#!/bin/bash | |
GOTCH_VERSION="${GOTCH_VER:-v0.3.8}" | |
CUDA_VERSION="${CUDA_VER:-10.1}" | |
GOTCH_PATH="$GOPATH/pkg/mod/github.com/sugarme/gotch@$GOTCH_VERSION" | |
# Install gotch | |
#============== | |
echo "GOPATH:'$GOPATH'" | |
echo "GOTCH_VERSION: '$GOTCH_VERSION'" |
#!/bin/bash | |
# Upgrade cmake and g++: | |
#======================= | |
apt remove --purge --auto-remove cmake | |
rm -rf /usr/lib/x86_64-linux-gnu/cmake | |
rm -rf /usr/local/bin/cmake | |
# cmake: ref https://apt.kitware.com/ | |
apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null |
# Setup sshd | |
apt-get update | |
apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null | |
# create an account on ngrok if not already and copy the authtoken | |
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
unzip ngrok-stable-linux-amd64.zip | |
read -p 'Enter the authtoken from ngrok :' authtoken | |
./ngrok authtoken $authtoken | |
./ngrok tcp 22 & |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
import { Component, Input } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
import { AngularFire, FirebaseListObservable } from 'angularfire2'; | |
import { Observable } from 'rxjs'; | |
declare var firebase: any; | |
interface Image { | |
path: string; |
public static string Base62Random() | |
{ | |
int random = _random.Next(); | |
return Base62ToString(random); | |
} | |
private static string Base62ToString(long value) | |
{ | |
// Divides the number by 64, so how many 64s are in | |
// 'value'. This number is stored in Y. |
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |