Skip to content

Instantly share code, notes, and snippets.

View dgrebb's full-sized avatar

Dan Grebb dgrebb

View GitHub Profile
@dgrebb
dgrebb / README.md
Last active April 12, 2024 02:49
Strapi CMS Custom Dashboard (Almost) Replacement Plugin

For brevity, filenames include parent directory(s). - substitutes /.

If installing Strapi fresh, and you're a filthy, untyped rotten scoundrel, remember to add compilerOptions.jsx = "react" as shown below in jsconfig.json to avoid the IDE SquiggleMonster.

  1. npx create-strapi-app@latest --quickstart --no-run strapi-dashbored
  2. npm run strapi generate
  3. choose "middleware"
  4. choose "Add middleware to root of project"
  5. edit src/middlewares/redirect.js
  6. edit config/middlewares.js
@dansp89
dansp89 / 000-readme.me
Last active May 5, 2024 20:28
STRAPI 4 - Add custom routes and also add to the SWAGGER documentation.
> With this code, you can add your custom routes in swagger, read the documentation if you have any further questions.
## Tested on:
1. Node 18.17.1
1. Strapi 4.15.5
1. Language: Typescript
@tforster
tforster / index.js
Last active December 23, 2023 00:25
Naked Redirector CloudFront Function
/**
* @description: Handler entry point.
* - Note AWS CloudFront Functions use a modified ECMAScript 5.1 compatible runtime and NOT NodeJS.
* - Use var, not const or let
* - Use string concatenation and not template literals
* - Beware that the CloudFront Functions Console editor and test environment do NOT mimic CloudFront 100%
* @date 2022-01-26
* @param {object} event: A CloudFront Function event (expecting a Viewer Request event)
* @return {object}: A CloudFront response or request object (depends whether conditions allow pass through or 301 redirect)
*/
@markreid
markreid / gitflowrebasing.md
Created January 17, 2017 04:30
git flow with rebasing
@chrisfcarroll
chrisfcarroll / AutoHotKey for a Mac User with PC keyboard on Windows.ahk
Last active January 11, 2024 11:19
A Pair of AutoHotKey Scripts for they who, being Mac Users, yet still insist on using Windows. One for an Apple keyboard, one for a PC keyboard. Also some arrange-windows-on-a-big-screen keys . Takes a similar approach as Parallels to keyboard mapping: rather than a wholesale swap of Cmd <-> Ctrl, instead duplicate favourite ctrl-key shortcuts t…
; Language: English
; Uses unicode. Save this file as utf-8 with BOM.
; Else it shall not work.
;
#NoEnv ; Recommended
SendMode Event
SetWorkingDir %userprofile% ; Ensures a consistent starting directory.
; === autotexts ========================================================
;
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active May 25, 2024 20:19
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@AllThingsSmitty
AllThingsSmitty / apple-mq.css
Last active June 23, 2022 19:56
iPhone 6/6 Plus and Apple Watch CSS media queries
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.
@toshimaru
toshimaru / jquery-scroll-bottom.js
Last active July 21, 2024 00:02
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.