- Updated on May 29 to accommodate etcd container not having
/bin/sh
available anymore.
curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
import { Controller, Get, Req, Res, UseGuards } from '@nestjs/common'; | |
import { Request, Response } from 'express'; | |
import { GoogleOauthGuard } from './google-oauth.guard'; | |
@Controller('auth/google') | |
export class GoogleOauthController { | |
constructor(private jwtAuthService: JwtAuthService) {} | |
@Get() | |
@UseGuards(GoogleOauthGuard) |
Working with protobuf in Go puts significant load on the memory subsystem, as protobuf-generated structures often contain a significant amount of pointers.
One way to minimize the number of allocations is to allocate all the fields at the same time, and then use internal pointers to wire them up.
import (
// ...
"github.com/rs/cors"
)
// ...
mux := runtime.NewServeMux()
proto.RegisterXYZServiceHandler(ctx, mux, conn)
package main | |
import ( | |
"net/http" | |
"time" | |
"golang.org/x/time/rate" | |
) | |
// ThrottledTransport Rate Limited HTTP Client |
function slice() { | |
local slice_width="${SLICEW:-1080}" | |
local width=$(identify -format "%[w]" $1) | |
local slices=$(($width/$slice_width)) | |
local name="${1%.*}" | |
echo -e "slice ($slices x $slice_width) for image $1" | |
convert -crop "${slices}x1@" $1 "${name}-%d.png" | |
} |
## Note, this file is written by cloud-init on first boot of an instance | |
## modifications made here will not survive a re-bundle. | |
## if you wish to make changes you can: | |
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg | |
## or do the same in user-data | |
## b.) add sources in /etc/apt/sources.list.d | |
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. |
# https://stackoverflow.com/a/12019115/2272992 by Awk
^(?=.{8,20}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$
└─────┬────┘└───┬──┘└─────┬─────┘└─────┬─────┘ └───┬───┘
│ │ │ │ no _ or . at the end
│ │ │ │
│ │ │ allowed characters
│ │ │
│ │ no __ or _. or ._ or .. inside
Want to use the excellent rich text editor Slate in a Rails app? Beware – since you'll be integrating React with your Rails app, it'll turn out pretty complicated and you'll have to do things (e.g. start server, managing dependencies, etc.) a bit differently than before. Let's start.
react_on_rails
is pretty much the best option for integrating React into Rails. Install it like so: