Skip to content

Instantly share code, notes, and snippets.

View smakinson's full-sized avatar

Shawn Makinson smakinson

View GitHub Profile
@ThePredators
ThePredators / readme-mde.md
Last active June 8, 2024 09:56
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

⚠️ The following configuration has been tested on Intel, M1 & M2 Ships ⚠️

Pre-requisit :

If you have any issues with macOS, or need anything related to it check this documentation

Install Xcode Command Line tools :

function countListener(onCountChange: (count: number) => void) {
const query = firebase.firestore().collection("fruits");
let count = 0;
return query.onSnapshot(snapshot => {
snapshot.docChanges().forEach(change => {
if (change.type === "added") onCountChange(++count);
if (change.type === "removed") onCountChange(--count);
});
});
}
# Source: https://gist.github.com/ae00efa6892fcb0b295bbdba73bef3ad
############################################
# Applying GitOps Principles Using Argo CD #
############################################
######################################
# Installing And Configuring Argo CD #
######################################
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
// please check https://docs.netlify.com/configure-builds/environment-variables/#declare-variables for most up to date info
// this was created before those docs existed
process.env = {
/**
*
* AUTOMATICALLY SET BY NETLIFY. IMMUTABLE!
* docs: https://www.netlify.com/docs/continuous-deployment/#environment-variables
*
*/
@d4rekanguok
d4rekanguok / widget-id.js
Last active August 29, 2019 03:00
ID widget for netlifyCMS
/**
* This is now a npm package!
* Please find the better version of this gist here:
* https://github.com/d4rekanguok/netlify-cms-widgets/blob/master/packages/widget-id/src/control.tsx
*/
@freddiemixell
freddiemixell / netlify.php
Last active February 15, 2021 11:24
WordPress Netlify Build Hook
<?php
// Somewhere off in your wp-config.php make sure you replace 123456 with your api key.
define( 'NETLIFY_API_KEY', '123456' );
// Somewhere off in your theme or even a plugin.
/**
* Netlify Webhook Build Function
*
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
@JesterXL
JesterXL / promiseall.js
Last active October 31, 2022 16:02
Example of using Array Destructuring for Promise.all.
Promise.all([
someThingThatReturnsAPromise(),
otherThingThatReturnsAPromise(),
lastThingThatReturnsAPromise()
])
.then( results =>
{
// this...
const [first, second, third] = results;
// ... instead of