Skip to content

Instantly share code, notes, and snippets.

View jezmck's full-sized avatar

Jez McKean jezmck

View GitHub Profile
@jeff-r-koyaltech
jeff-r-koyaltech / gen-firebase-rewrites.js
Last active April 18, 2024 07:10
Next.js and Firebase - dynamic / "slug" routing generation script
/* Purpose
Firebase needs certain rewrite rules in place, in order to function properly with
Next.js' static routing. This only applies to statically generated Next.js
projects (i.e. built by 'next build' 'next export')
Inspired by the discussion at:
https://github.com/firebase/firebase-js-sdk/discussions/4980
*/
@aallan
aallan / async_webserver.py
Created July 4, 2022 15:38
An asynchronous webserver written in MicroPython to turn an LED on/off on a Raspberry Pi Pico W
import network
import socket
import time
from machine import Pin
import uasyncio as asyncio
led = Pin(15, Pin.OUT)
onboard = Pin("LED", Pin.OUT, value=0)
@pixelbrackets
pixelbrackets / git-change-commit-date.sh
Last active April 10, 2022 18:13
Change date of a selected commit or all commits
#!/usr/bin/env bash
# Usage:
# ./git-change-commit-date.sh <commit id | 'all' >
# Example:
# ./git-change-commit-date.sh e119b94 # change commit with id e119b94
# ./git-change-commit-date.sh all # changes all commits
#
# Warning! rebase/filter will change the history
#!/usr/bin/env python3
from rak811 import Mode, Rak811
import time
lora = Rak811()
lora.hard_reset()
lora.mode = Mode.LoRaWan
lora.band = 'EU868'
lora.set_config(dev_eui='xxxxxxxxxxxxxxxx',
app_eui='xxxxxxxxxxxxxxxx',
@SteveKennedy
SteveKennedy / removeAdFramework.js
Last active August 1, 2021 13:35
Cordova Hook - Removes Ad Framework From Plugin.XML
// This Cordova Hook (script) removes "AdSupport.framework" and "libAdIdAccess" references
// from the cordova-plugin-google-analytics plugin, as well as removes it from
// references found in the corresponding node_module and .project.pbxproj.
// The authoritive source is found at: https://gist.github.com/SteveKennedy
module.exports = function (ctx) {
console.log("Attempting To Remove Ad (IDFA) References from project....")
var pluginName = 'cordova-plugin-google-analytics';
@balupton
balupton / next.config.js
Created February 3, 2017 16:00
next.js webpack configs
module.exports = {
webpack: (config) => {
const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
config.plugins = config.plugins || []
config.plugins.push(new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en/))
config.plugins.push(new BundleAnalyzerPlugin())
return config
}
}
@ddo
ddo / README.md
Last active March 24, 2023 19:17 — forked from nicerobot/README.md
uninstall-node.sh

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

@jareware
jareware / SCSS.md
Last active April 23, 2024 22:13
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso