Skip to content

Instantly share code, notes, and snippets.

Avatar

J Joostvanderlaan

View GitHub Profile
@Joostvanderlaan
Joostvanderlaan / #linting.md
Last active Feb 9, 2020 — forked from codfish/#linting.md
Prettier + ESLint + airbnb config + Husky + lint-staged + commitlint + markdownlint
View #linting.md

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:

@uogbuji
uogbuji / pixelbook-dev-setup.md
Last active Feb 5, 2021 — forked from cassiozen/pixelbook-dev-setup.md
Notes on setting up Pixelbook for development
View pixelbook-dev-setup.md

Pixelbook or Pixel Slate Setup

Updated August 2020

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 he 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.

Change your channel

Almost all the features mentioned in this document now work on stable challen, ut if you decide to use beta or dev to get the latest you can do the following:

@codfish
codfish / #linting.md
Last active Feb 24, 2021
Prettier + ESLint + airbnb + Husky + lint-staged + commitlint
View #linting.md

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 Oct 16, 2019
Script to setup the Hardkernel Odroid HC1/2 and XU4 for Wireguard and Resilio-sync
View setup-sync-node.sh
#!/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 Oct 26, 2020
A hugo img srcset partial that auto resizes images
View hugo-img-srcset.html
<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 Jul 7, 2018 — forked from tsuri/preemtible_kubernetes.md
kubernetes cluster w/ pre-emptible instances
View preemtible_kubernetes.md

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 Apr 18, 2020
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".
View nr-deploy-post-merge-hook.sh
#!/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 Dec 7, 2015
Use Service Worker to load fonts async/direct via client-side logic.
View sw-font-load.js
// 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'
) {
@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active Feb 8, 2021
The perfect Varnish configuration for Joomla, WordPress & other CMS based websites
View default.vcl_PREFACE.md

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites.

This configuration requires an HTTP Header and a user cookie to identify if a user is logged in a site, in order to bypass caching overall (see how it's done for Joomla & WordPress). If your CMS provides a way to add these two requirements, then you can use this configurati

@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active Feb 20, 2021
Event-stream based GraphQL subscriptions for real-time updates
View Event-stream based GraphQL subscriptions.md

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.