Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
![Screenshot 2023-12-18 at 10 40 27 PM](https://private-user-images.githubusercontent.com/3837836/291468646-4c30ad72-76ee-4939-a5fb-16b570d38cf2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MDM4MjEsIm5iZiI6MTcyMTcwMzUyMSwicGF0aCI6Ii8zODM3ODM2LzI5MTQ2ODY0Ni00YzMwYWQ3Mi03NmVlLTQ5MzktYTVmYi0xNmI1NzBkMzhjZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMDI1ODQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmZmNjljYTA2MjEyNDhiZGFlMTBlNTAxZWJkZjhkNzFhOGU2MDg5YjUyMDRhNTkzMjlmOTRhMjE0MDlkM2Y4ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._M0gUuDqDq1qSPEIdf8e31ypW6r07WiOnGFS3Sbd1tk)
type CacheMetadata = { | |
createdTime: number | |
maxAge: number | null | |
expires: number | null | |
} | |
function shouldRefresh(metadata: CacheMetadata) { | |
if (metadata.maxAge) { | |
return Date.now() > metadata.createdTime + metadata.maxAge | |
} |
package main | |
import ( | |
"bytes" | |
"io/ioutil" | |
"log" | |
"os" | |
"os/exec" | |
) |
#!/bin/bash | |
IMAGE="gcr.io/google-containers/ubuntu-slim:0.14" | |
COMMAND="/bin/bash" | |
SUFFIX=$(date +%s | shasum | base64 | fold -w 10 | head -1 | tr '[:upper:]' '[:lower:]') | |
usage_exit() { | |
echo "Usage: $0 [-c command] [-i image] PVC ..." 1>&2 | |
exit 1 | |
} |
// | |
// Quick & Dirty Google Cloud Storage emulator for tests. Requires | |
// `stream-buffers` from npm. Use it like this: | |
// | |
// `new MockStorage().bucket('my-bucket').file('my_file').createWriteStream()` | |
// | |
class MockStorage { | |
buckets: {[name: string]: MockBucket}; |
package enum_example | |
import ( | |
"bytes" | |
"encoding/json" | |
) | |
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred | |
type TaskState int |
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) === | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# ~ Updated December 2021 ~ | |
# | |
# | |
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
# |
rx.Observable.prototype.safeSubscribe = function(scope, fn, err, cmp) { | |
var disposable = this.safeApply(scope, fn).subscribe(angular.noop, err, cmp); | |
scope.$on("$destroy", function() { | |
disposable.dispose(); | |
}); | |
return disposable; | |
}; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
$scope.safeApply = function(fn) { | |
var phase = this.$root.$$phase; | |
if(phase == '$apply' || phase == '$digest') | |
this.$eval(fn); | |
else | |
this.$apply(fn); | |
}; | |
// OR |