Skip to content

Instantly share code, notes, and snippets.

View gyro.py
def gyro_drive(self, speed, heading, distance):
self.robot.reset()
actual_distance = 0
while actual_distance < distance:
correction = self.gyro.angle() * -10
self.robot.drive(speed, correction)
wait(10)
actual_distance = self.robot.distance()
View builder.go
func (b *Builder) RegularBuild(group BuildpackGroup, workspaceDir, layersDir string) (*BuildMetadata, error) {
platformDir, err := filepath.Abs(b.PlatformDir)
if err != nil {
return nil, err
}
layersDir, err := filepath.Abs(layersDir)
if err != nil {
return nil, err
}
appDir, err := filepath.Abs(workspaceDir)
View sample-buildpack.toml
api = "<buildpack API version>"
[buildpack]
id = "<buildpack ID>"
name = "<buildpack name>"
version = "<buildpack version>"
homepage = "<buildpack homepage>"
clear-env = false
privileged = true
View tekton-buildpacks.yml
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: buildpacks-phases
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: image-build
View project-inline-buildpacks.toml
[[build.buildpacks]]
id = "cnb/make"
version = "1.0"
[[build.buildpacks]]
uri = "https://github.com/heroku/nodejs-engine-buildpack/releases/download/v0.4.4/nodejs-engine-buildpack-v0.4.4.tgz"
[[build.buildpacks]]
uri = "docker://gcr.io/projectriff/node-function:0.6.1"
View project-mixins.toml
[project]
id = "io.buildpacks.my-app"
version = "0.1"
[build]
include = [
"cmd/",
"go.mod",
"go.sum",
"*.go"
View inline-scriptless-buildpack.toml
[project]
id = "my-app"
[[build.buildpacks]]
id = "example/jvm"
version = "1.0"
[[build.buildpacks]]
id = "example/ruby"
version = "1.0"
View build.bash
#!/usr/bin/env bash
apt update
apt install imagemagick
cat << EOF > ${1}/privileged.toml
[[layers]]
paths = [ "/usr" ]
launch = true
build = true
View cnb-overlay.txt
$ docker run --rm --privileged -it heroku/heroku:18-build bash
root@f1442b4c03bb:/# mkdir -p /tmp/overlay && mount -t tmpfs tmpfs /tmp/overlay && mkdir -p /tmp/overlay/{usr,work}
root@f1442b4c03bb:/# mount -t overlay -o lowerdir=/usr,upperdir=/tmp/overlay/usr/,workdir=/tmp/overlay/work/ overlay /usr/
root@f1442b4c03bb:/# apt update
...
root@f1442b4c03bb:/# apt install tree
Reading package lists... Done
@jkutner
jkutner / first-telescope.md
Last active May 2, 2020
How to Pick Your First Telescope
View first-telescope.md

How to Pick Your First Telescope

I've been an amateur astronomer for more years than I can count, and I've helped many people choose their first telescope.

However, I usually recommend that most people start with a very good pair of binoculars instead of a telescope. High-end binoculars are wonderful instruments that will remain useful even if you decided to upgrade to a telescope. I still use mine regularly despite owning multiple high-quality telescopes. They're just fun and easy.

Celestron Skymaster Binoculars

  • $100-$150
You can’t perform that action at this time.