Skip to content

Instantly share code, notes, and snippets.

View CrashLaker's full-sized avatar
💭
🌌 Wired

Carlos Aguni • 顾宁 CrashLaker

💭
🌌 Wired
View GitHub Profile
@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@robskillington
robskillington / prometheus.proto
Last active February 15, 2024 22:23
Example Python Prometheus remote write client
// Copyright 2016 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@joastbg
joastbg / mpi_ring.cc
Created July 12, 2014 20:55
MPI test program, sending messages in a ring
#include <mpi.h>
int main(int argc, char** argv)
{
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
/**
* 遗留的问题: 这是utf-8 ??
* 关于encodeURIComponent 与 encodeURI 的最佳实践
* http://stackoverflow.com/questions/75980/best-practice-escape-or-encodeuri-encodeuricomponent
*
Unicode Strings
In most browsers, calling window.btoa on a Unicode string will cause a Character Out Of Range exception.
To avoid this, consider this pattern, noted by Johan Sundström