Skip to content

Instantly share code, notes, and snippets.

View drackp2m's full-sized avatar
🛀
With peace of mind.

Marc Jovaní González drackp2m

🛀
With peace of mind.
  • Bit2Me
  • Castellón de la Plana, Spain
  • 02:29 (UTC +02:00)
View GitHub Profile
@Klerith
Klerith / Dockerfile
Last active July 18, 2024 18:27
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Build the app with cache dependencies
FROM node:18-alpine3.15 AS builder
@cahilfoley
cahilfoley / Semaphore.ts
Created February 25, 2020 03:10
Simple TypeScript implementation of a semaphore
import { cpus } from 'os'
/**
* A lock that is granted when calling [[Semaphore.acquire]].
*/
type Lock = {
release: () => void
}
/**
@bmhatfield
bmhatfield / .profile
Last active June 18, 2024 09:38
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@zuckercode
zuckercode / gist:3720747
Created September 14, 2012 08:27
add new user with zsh as default shell
#!/bin/bash
read -p "please provide a name for a new user:" name
if [ "$name" == "" ]; then
echo "You did not entered a user name, so no user will be added."
exit;
fi
USER=$name
HOME=/home/$USER