This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! stackexchange-max-login-streak.js | Samuel Jones 2022 | MIT License | gist.github.com/samthecodingman */ | |
/* | |
* == USAGE == | |
* 1. Review and vet the below code | |
* 2. Open your profile page on the relevant SE site (e.g. https://stackoverflow.com/users/3068190/samthecodingman) | |
* 3. Open your Browser's JavaScript console (usually Ctrl+Shift+J or F12) | |
* 4. Paste and execute this helper script | |
* 5. Take note of the stats logged to the console | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! firestore-fetch-documents-by-id.js | Samuel Jones 2021 | MIT License | gist.github.com/samthecodingman */ | |
// on server: | |
import * as firebase from "firebase-admin"; | |
// on client: | |
// import firebase from "firebase/app"; | |
// import "firebase/firestore"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! firestore-multi-batch.ts | Samuel Jones 2021 | MIT License | gist.github.com/samthecodingman */ | |
import { firestore } from "firebase-admin"; | |
/** | |
* Helper class to compile an expanding `firestore.WriteBatch`. | |
* | |
* Using an internal operations counter, this class will automatically start a | |
* new `firestore.WriteBatch` instance when it detects it has hit the operations | |
* limit of 500. Once prepared, you can commit the batches together. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:{let regex;window.location.href.indexOf("/github.com")>-1?(regex=new RegExp("/(\\w+)/([^/?]+)").exec(window.location.pathname))!=null?window.location.assign("https://"+regex[1]+".github.io/"+regex[2]):alert("Error: RegExp couldn't identify user and repo."):window.location.href.indexOf("github.io")>-1?(regex=new RegExp("/(\\w+).github.io/([^/?]+)").exec(window.location.href))!=null?window.location.assign("https://github.com/"+regex[1]+"/"+regex[2]):alert("Error: RegExp couldn't identify user and repo."):alert("Error: Not a GitHub page or repo.");} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! firestoreTransforms.js | Samuel Jones 2019 | MIT License | gist.github.com/samthecodingman */ | |
/** | |
* @file A file containing common firestore idioms used with queries | |
* @author Samuel Jones 2017 (github.com/samthecodingman) | |
* @license MIT | |
* @module firestore-transforms | |
*/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! extendGetter.js | Samuel Jones 2017 | MIT License | gist.github.com/samthecodingman */ | |
/** | |
* @file Extends built-in getter functions | |
* @author Samuel Jones 2017 (github.com/samthecodingman) | |
*/ | |
// Example usage: Overwrite `req.protocol` when behind a Google App Engine CDN/proxy | |
// extendGetter(req, 'protocol', function() { | |
// let xHttps = this.get('x-appengine-https'); // eslint-disable-line | |
// if (!xHttps) return; // header not present - fallback to internal getter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2019 Samuel Jones (@samthecodingman). All Rights Reserved. | |
* Copyright 2016 Google Inc. All Rights Reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; [COMPATIBILITY FUNCTION] Get command line arguments as an array (AHK v1.0.90+) | |
; by @samthecodingman [MIT License] | |
; You can use A_Args directly if using AHK v1.1.27 or later. | |
GetArgsArray() { | |
static _arr | |
global ; Give access to %0%, %1%, %2%, etc. for before v1.1.27 | |
if (not _arr) | |
_arr := A_Args ; shortcut for v1.1.27+ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; [DEMO] Shaded Icons in a ListView | |
; Description: Demonstrates the use of icons in a ListView to show shading for a row | |
; Author: Samuel Jones (@samthecodingman) | |
; Created: 21 NOV 2018 | |
; Last-Modified: 21 NOV 2018 | |
; License: MIT (https://opensource.org/licenses/MIT) | |
; URL: https://gist.github.com/samthecodingman/44e58a47a0b2d07c8553f036285f5c4b | |
; Requires AHK v1.0.46 or later. Demo itself not compatible with AHK v2, but concept is. |
NewerOlder