Skip to content

Instantly share code, notes, and snippets.

View AubreyHewes's full-sized avatar
💭
I may be slow to respond.

Aubrey AubreyHewes

💭
I may be slow to respond.
View GitHub Profile
@rocketeerbkw
rocketeerbkw / README.md
Created November 16, 2023 14:31
Lagoon Storage Charts

PoC Lagoon Environment Storage Charts

Generates a set of line charts to plot detailed storage information for all environments in a project. Can help when comparing the compiled data in a billing tool to the raw data from Lagoon.

Instructions

  1. Get a copy of the storage data from the Lagoon API and save it as a file.
@tannerlinsley
tannerlinsley / README.md
Last active April 12, 2024 17:04
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@AubreyHewes
AubreyHewes / ttf-mscorefonts-installer.sh
Last active October 24, 2018 08:47
ttf-mscorefonts-installer failure Ubuntu 18 18.04 18.10
#!/bin/bash
# After updating from 17.04 I get apt errors as the `ttf-mscorefonts-installer` package is not downloading
# the fonts properly timeouts/forbidden et al
sudo apt purge ttf-mscorefonts-installer
wget http://httpredir.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.7_all.deb
sudo apt install ./ttf-mscorefonts-installer_3.7_all.deb && rm ./ttf-mscorefonts-installer_3.7_all.deb
@joaquimadraz
joaquimadraz / missile_launcher.rb
Created May 13, 2018 12:01
Dream Cheeky USB Missile Launcher
# REFERENCES
# https://github.com/codedance/Retaliation/blob/master/retaliation.py
# http://www.rkblog.rk.edu.pl/w/p/controlling-usb-missile-launchers-python/
# http://matthias.vallentin.net/blog/2007/04/writing-a-linux-kernel-driver-for-an-unknown-usb-device/
require 'libusb'
class Launcher
ID_PRODUCT = 0x0701
ID_VENDOR = 0x0a81
@hk-skit
hk-skit / js-oneliner.js
Last active January 9, 2024 23:46
Useful Array One-liners.
// Remove Duplicates from an array
const removeDuplicates =
arr => arr.filter((item, index) => index === arr.indexOf(item));
const removeDuplicates1 = array => [...new Set(array)];
const removeDuplicates2 = array => Array.from(new Set(array));
// Flattens an array(doesn't flatten deeply).
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ChartJS from 'chart.js';
/**
* React Wrapper Component for ChartJS charts
* Based on comment by @MatthewHerbst @https://github.com/reactjs/react-chartjs/issues/112
*
* For chart documentation see @see http://www.chartjs.org/docs/latest
*/
@Gaya
Gaya / redux-form-react-quill.jsx
Created November 9, 2017 16:00
How to use React Quill inside Redux Forms
import React from 'react';
import { Field } from 'redux-form';
import ReactQuill from 'react-quill';
function renderQuill({ input }) {
return (
<ReactQuill
{...input}
onChange={(newValue, delta, source) => {
if (source === 'user') {
@AubreyHewes
AubreyHewes / rules-both.iptables
Created October 26, 2017 15:48 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@tomhazledine
tomhazledine / calculate_reading_time.php
Created November 16, 2016 08:30
Calculate Reading Time (for WordPress content)
<?php
/**
* READING TIME
*
* Calculate an approximate reading-time for a post.
*
* @param string $content The content to be measured.
* @return integer Reading-time in seconds.
*/
function reading_time( $content ) {
@hugochinchilla
hugochinchilla / slack_munin.sh
Last active July 7, 2023 14:53 — forked from anarchivist/slack_munin.sh
Slack notification script for Munin
#!/bin/bash
# Slack notification script for Munin
# Mark Matienzo (@anarchivist)
#
# To use:
# 1) Create a new incoming webhook for Slack
# 2) Edit the configuration variables that start with "SLACK_" below
# 3) Add the following to your munin configuration:
#