Skip to content

Instantly share code, notes, and snippets.

@lohhans
lohhans / README-PTBR.md
Last active May 4, 2024 01:32 — forked from PurpleBooth/README-Template.md
Um modelo para fazer um bom README.md

Título do projeto

Um parágrafo da descrição do projeto vai aqui

🚀 Começando

Essas instruções permitirão que você obtenha uma cópia do projeto em operação na sua máquina local para fins de desenvolvimento e teste.

Consulte Implantação para saber como implantar o projeto.

@vkhorikov
vkhorikov / CustomerController.cs
Last active May 4, 2024 01:25
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@varqox
varqox / install_debian_with_debootstrap_howto.md
Last active May 4, 2024 01:24
Instructions how to install Debian using debootstrap
@alucard001
alucard001 / Dockerfile
Last active May 4, 2024 01:19
Docker + Laravel + Nginx + Swoole Reverse Proxy Setup
FROM php_base:latest
RUN apt update -y && apt upgrade -y
WORKDIR /var/www/html
RUN composer update --optimize-autoloader
COPY src/. /var/www/html
COPY build/php/.env.local /var/www/html/.env
@gwenn
gwenn / go-sqlite3_database_is_locked.go
Last active May 4, 2024 01:19 — forked from mrnugget/go-sqlite3_database_is_locked.go
Program that tests the concurrency issues with go-sqlite3. This will create two tables: `products` and `users`. One goroutine will repeatedly read from the `products` table in N fresh goroutines. At the same time ONE goroutine writes to the other table.
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"
@ravecat
ravecat / README.md
Last active May 4, 2024 01:18
debootstrap, livecd

A live CD or live DVD is a complete bootable Linux operating system loaded from a CD or DVD. Although there are a lots of live Linux CDs, for seemingly every taste and purpose, it might still be useful on occasion to build your own. This guide details the steps to build a bootable live CD/DVD based on Debian “wheezy”.

Step 1 – Installing the necessary software

These are the software packages you need to install on your Debian system:

apt-get install xorriso live-build syslinux squashfs-tools

Step 2 – Create a basic filesystem

@joaovictorino
joaovictorino / entendendo processos em contêineres Docker.md
Last active May 4, 2024 01:16
entendendo processos em contêineres Docker

Entendendo processos em contêineres Docker

Agora vamos visualizar os processos dentro de contêineres Docker, rode o comando abaixo

docker run -d nginx

Quando contêiner nginx estiver rodando, execute este outro comando e perceba que o nginx criou vários PIDs (process ids) dentro do contêiner para que o servidor web funcione

@joaovictorino
joaovictorino / trabalhando com estados de contêineres Docker.md
Last active May 4, 2024 01:16
trabalhando com estados de contêineres Docker

Trabalhando com estados de contêineres Docker

Com o comando abaixo baixamos uma imagem do Docker Hub para a máquina local

docker pull alpine

Crie o contêiner e deixe-o pronto para execução

@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active May 4, 2024 01:12
setup L2TP IPSEC VPN in archlinux using NetworkManager
@ynagatomo
ynagatomo / Extension+ModelComponent.swift
Created April 29, 2024 11:48
An extension of ModelComponent, to dump its MeshResource.Model such as positions and normals.
extension ModelComponent {
/// Dump the MeshResource.Model
func dumpMeshResourceModel() {
let printSIMD3Float = { (value: SIMD3<Float>) in
print("(\(value.x), \(value.y), \(value.z)), ", terminator: "")
}
let printSIMD2Float = { (value: SIMD2<Float>) in
print("(\(value.x), \(value.y)), ", terminator: "")
}