mkdir $HOME/go
mkdir -p $HOME/go/src/github.com/YOUR_USERNAME
-p
means to create intermediate directories as required.
export GOPATH=$HOME/go
// Author: Rheza Satria (c) 2015 | |
// Please mention this gist if you inspired/used it! | |
public static Bitmap applyDCT(Bitmap image, int blockSize) { | |
int _w = image.getWidth(); | |
int _h = image.getHeight(); | |
// Preload the opencv_objdetect module to work around a known bug. | |
Loader.load(opencv_objdetect.class); | |
AndroidFrameConverter afc = new AndroidFrameConverter(); | |
Frame frame = afc.convert(image); |
/** | |
* Generates number of random geolocation points given a center and a radius. | |
* @param {Object} center A JS object with lat and lng attributes. | |
* @param {number} radius Radius in meters. | |
* @param {number} count Number of points to generate. | |
* @return {array} Array of Objects with lat and lng attributes. | |
*/ | |
function generateRandomPoints(center, radius, count) { | |
var points = []; | |
for (var i=0; i<count; i++) { |
// !!!!!!!!!!! | |
// Move this file to inside `pages` directory | |
// !!!!!!!!!!! | |
import React from "react"; | |
import Validator from "fastest-validator"; | |
class Index extends React.Component { | |
render() { | |
const v = new Validator(); |
https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances?hl=en を参考に Compute Engine で nested VM を構築。
gcloud config set compute/zone us-central1-b
gcloud compute disks create disk1 --image-project debian-cloud --image-family debian-9
gcloud compute images create nested-vm-image --source-disk disk1 --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
gcloud compute instances create example-nested-vm --image nested-vm-image --min-cpu-platform="Intel Skylake"
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: backend-config | |
data: | |
APP_DEBUG: "false" | |
APP_ENV: production | |
APP_KEY: changeme | |
APP_LOG_LEVEL: debug | |
APP_NAME: "Laravel K8s" |
use actix_http::Error; | |
use actix_service::ServiceFactory; | |
use actix_web::{dev, web, App}; | |
use sqlx::{AnyPool}; | |
pub fn create_app( | |
data: &Data, | |
) -> App< | |
impl ServiceFactory< |
[package] | |
xxxx | |
[dependencies] | |
actix = "0.10.0-alpha.3" | |
actix-cors = "0.3.0-alpha.1" | |
actix-http = "2.0.0-beta.3" | |
actix-rt = "1" | |
actix-service = "1.0.6" | |
actix-web = { version = "3.0.0-beta.3", features = ["rustls"] } |
[package] | |
name = "http" | |
description = "HTTP server" | |
version = "0.0.1" | |
license = "MIT" | |
authors = ["Singh <[email protected]>"] | |
edition = "2018" | |
[[bin]] | |
name = "http" |