Skip to content

Instantly share code, notes, and snippets.

View fesplugas's full-sized avatar
🐿️

Francesc Esplugas fesplugas

🐿️
View GitHub Profile
@peterwwillis
peterwwillis / cliv
Last active May 2, 2021 19:01
cliv: Command-LIne wrapper to execute different Versions of binaries in different directories using different environment variables
#!/usr/bin/env sh
# cliv - Execute commands using a specific .env and directory
set -eu
_err () { printf "%s\n" "$0: Error: $*" ; exit 1 ; }
HOME="${HOME:-$(getent passwd $(id -u) | cut -d : -f 6)}"
[ -d "$HOME/.cliv" ] || mkdir -p "$HOME/.cliv"
if [ $# -lt 1 ] || [ "$1" = "-h" ] ; then
@hopsoft
hopsoft / Dockerfile
Last active May 17, 2023 19:58
Dockerize your Rails app
FROM ruby:3.0-alpine
RUN apk add --no-cache --update \
ack \
bash \
build-base \
curl \
git \
htop \
less \
@ctsrc
ctsrc / README.md
Last active April 29, 2024 19:18 — forked from niw/README.en.md
Guide: Run FreeBSD 13.1-RELEASE for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc) with HVF acceleration (Hypervisor.framework)
@afcapel
afcapel / journal.rb
Last active February 2, 2021 06:55
Script at ~/bin/journal I use to keep a journaling practice
#!/usr/bin/env ruby --disable-gems
require "date"
require "fileutils"
JOURNAL_DIR = File.expand_path("~/Google Drive/writing/journal")
now = DateTime.now
date = now.strftime("%F")
@jferris
jferris / configmap.yaml
Last active February 8, 2024 14:15
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
@pwillis-els
pwillis-els / Jenkinsfile
Created November 25, 2020 06:07
Supply Git username/password via environment variables, plus sample Jenkinsfile
node('node-label') {
stage('Checkout') {
scm checkout
}
stage('Tag') {
sh 'git tag my-tag'
sh 'sh git-credential-env.sh --install'
withCredentials([[
# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@chriselsner
chriselsner / nix-on-macos-catalina.md
Last active January 24, 2024 18:35
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.