Skip to content

Instantly share code, notes, and snippets.

View mhaylock's full-sized avatar

Mark Haylock mhaylock

  • abitofthought.com
  • Christchurch, New Zealand
View GitHub Profile
@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active April 26, 2024 08:54
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@ifyoumakeit
ifyoumakeit / github-conventional-comments.js
Last active March 21, 2024 14:52
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",
@annikoff
annikoff / custom_generators.md
Last active February 22, 2024 14:09
Custom generators

The main generator

# lib/generators/rails/policy/policy_generator.rb

module Rails
  module Generators
    class PolicyGenerator < NamedBase
      source_root File.expand_path('templates', __dir__)

      def copy_policy_file
@Jimmy-Z
Jimmy-Z / services-start.sh
Created February 28, 2019 08:42
multi SSID with VLAN script, for ASUS AC86U with merlin
#!/bin/sh
# multi SSID with VLAN script, for ASUS AC86U with merlin
#
# setup before hand:
# set "router" to "AP Mode"
# this will put all ports and wireless in br0
# create 2 guest network
# enable Administration => System => Enable JFFS custom scripts and configs
# put this script in /jffs/scripts/, name should be "services-start"
@jonoirwinrsa
jonoirwinrsa / process-bugsnag-sourcemaps.js
Created February 16, 2019 15:18
Upload Create React App sourcemaps to Bugsnag - Complete
const { upload } = require('bugsnag-sourcemaps');
const glob = require('glob');
const fs = require('fs');
const appVersion = require('./package.json').version;
const reportBuild = require('bugsnag-build-reporter');
/**
* Find all of the map files in ./build
*/
function findSourceMaps(callback) {
@hellendag
hellendag / mergeResolvers.js
Last active November 20, 2023 19:16
Merge mocked GraphQL resolvers
// @flow
type ResolvedScalar = string | number | boolean | null;
type ResolvedValue =
| ResolvedScalar
| Array<ResolvedValue>
| {[key: string]: ResolvedValue};
type ResolverFunction = (...args: Array<any>) => ResolvedValue;
export type ResolverMap = {

Libraries and Tools for React

If you're developing an application based on React it can be helpful if you don't need to develop all the basic UI components yourself. Here you can find a list with various components, component libraries and complete design systems developed with and for React.

As the list got longer and longer I thought it would be better to have a "real" site for it.

👉 Please find the (new) list here: https://react-libs.nilshartmann.net/

@kobake
kobake / git-commit-size.sh
Created November 5, 2017 13:42
Calculate size of a git commit object.
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: git-commit-size.sh <commit hash>" 1>&2
exit 1
fi
HASH=$1
ITEM_LIST="`git diff-tree -r -c -M -C --no-commit-id $HASH`"
#!/usr/bin/env ruby
require "heroku_env_audit"
require "json"
pipelines = JSON.parse(`heroku pipelines --json`, symbolize_names: true)
pipelines.each do |pipeline|
info = JSON.parse(`heroku pipelines:info #{pipeline[:name]} --json`, symbolize_names: true)

A better git branch

I'll often use branches to try out experiments, ideas, and to separate different trains of thought. Not every branch gets merged – in fact, it's quite common for me to make several commits on a branch, look at the end result, and throw the branch away without ever merging it (branching is cheap and ideas are cheap, but bad code is expensive). As a result, I can end up with a lot of branches. This makes the output of git branch difficult to sort through:

$ git branch
* account-org-association
  acdx-blog-posts
  add-static-resource-support
  alter-component-naming