Skip to content

Instantly share code, notes, and snippets.

@exavolt
exavolt / Dockerfile
Last active April 4, 2024 21:09
Containerized Hugo (extended) with VSCode devcontainer
FROM golang:1.13-alpine
# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
ARG VARIANT=hugo_extended
# VERSION can be either 'latest' or a specific version number
ARG VERSION=latest
RUN apk add --update --no-cache ca-certificates openssl git curl && \
case ${VERSION} in \
latest) \
@javdl
javdl / #linting.md
Last active June 28, 2022 14:31 — forked from codfish/#linting.md
Prettier + ESLint + airbnb config + Husky + lint-staged + commitlint + markdownlint

Joost:

  • added steps to fix markdown via cli (extra script)

  • autofix in vs code on save, add this setting:

    "editor.codeActionsOnSave": { "source.fixAll.markdownlint": true }

original:

@keijiro
keijiro / borg-with-gs.md
Last active February 5, 2024 01:58
Using Borg and Google Cloud Storage for backing up personal projects

Why do you prefer [Borg] over [git-lfs]/[git-annex]?

  • GitHub LFS has a 2GB limit on file size. This never works with large projects like video productions.
  • git-annex uses symlinks to manage annexed files. This doesn't work well on Windows.

So my conclusion at the moment is that Borg is the best backup software for mid/large-sized personal projects.

@uogbuji
uogbuji / pixelbook-dev-setup.md
Last active July 10, 2023 14:53 — forked from cassiozen/pixelbook-dev-setup.md
Notes on setting up Pixelbook for development

Pixelbook or Pixel Slate Setup

Partly updated June 2023

General caution: Chrome OS is a secure OS by design, but this has at least one key consequence. If you change your Google account password, you will still be required to enter the old password the next time you access each Chrome OS device. Devices are encrypted with that password, so the OS needs to decrypt using the old password then re-encrypt using the new one. If you forget your old password you will lose access to your Chrome OS device data. As always, make sure you keep backups up to date.

Fast User Switching

If you have multiple Chrome OS accounts (Say, work and play), you can quickly sitch between them without logging out:

@codfish
codfish / #linting.md
Last active July 5, 2023 12:29
Prettier + ESLint + airbnb + Husky + lint-staged + commitlint

My personal & professional linting setup. Extends airbnb's ESLint config first, then Prettier. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies.

Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives.

To understand more, see https://github.com/codfish/eslint-config-codfish.

To avoid having to manually setup everything and add all configuration/boilerplate code to your project, use cod-scripts instead. It was forked from kcd-scripts and ultimately inspired by react-scripts.

Why

@simora
simora / setup-sync-node.sh
Last active October 16, 2019 21:09
Script to setup the Hardkernel Odroid HC1/2 and XU4 for Wireguard and Resilio-sync
#!/bin/bash
function set_hostname() {
read -r -p 'Hostname: ' hostname
hostname $hostname
}
function install_pkgs() {
apt install -y vim libmnl-dev libelf-dev build-essential pkg-config git parted xfsprogs
apt-mark hold linux-odroid-5422
@randallmlough
randallmlough / hugo-img-srcset.html
Last active May 8, 2021 12:31
A hugo img srcset partial that auto resizes images
<style>
img {
max-width: 100%;
}
</style>
<h1>Creating a srcset loop based on Resources</h1>
<!--
NOTE: This requires Hugo 0.32
@rimusz
rimusz / preemtible_kubernetes.md
Last active July 7, 2018 02:52 — forked from tsuri/preemtible_kubernetes.md
kubernetes cluster w/ pre-emptible instances

Kubernetes clusters using preemtible instances

Motivation

People experimenting with kubernetes clusters on the GKE not necessarily have money to keep a full cluster on at all time. GKE clusters can be easily resized, but this still incurs in the full instance cost when the cluster is up.

Google has added preemptible instances that are ideal for many

@UndefinedOffset
UndefinedOffset / nr-deploy-post-merge-hook.sh
Last active July 9, 2021 10:19
A simple git deploy hook for notifying New Relic of deployments, it assumes that the base folder name of the repository is the application name. To set git to use this script you simply add this file into your .git/hooks folder as "post-merge".
#!/bin/bash
#New Relic API Key see https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/api-key#creating
NR_API_KEY="INSERT_API_KEY_HERE"
#Find New Relic App Name, if your top level folder is not the name of your application change the below two lines to simply NR_APP_NAME="MY_APP_NAME".
NR_APP_NAME=$(git rev-parse --show-toplevel)
NR_APP_NAME=$(basename "$NR_APP_NAME")
#Get the current git branch
@rupl
rupl / sw-font-load.js
Created December 7, 2015 11:54
Use Service Worker to load fonts async/direct via client-side logic.
// Load fonts async by default
// Load sync from SW cache when available.
//
// Snippet assumes your Service Worker caches fonts as part of installation, so that
// an 'activated' Service Worker means the fonts are cached with 100% confidence.
if (
'serviceWorker' in navigator &&
navigator.serviceWorker.controller !== null &&
navigator.serviceWorker.controller.state === 'activated'
) {