Skip to content

Instantly share code, notes, and snippets.

@rodmcnew
rodmcnew / express js dump response body.js
Created October 29, 2021 23:17
express js dump response body.js
app.use('/oidc',function (req, res, next) {
const oSend = res.end;res.end = (a,b,c) => {console.log('rod send', a,b,c);res.send=oSend;res.send(a,b,c)};
const oAppend = res.end;res.end = (a,b,c) => {console.log('rod append', a,b,c);res.append=oAppend;res.append(a,b,c)};
const oEnd = res.end;res.end = (a,b,c) => {console.log('rod end', a,b,c);res.end=oEnd;res.end(a,b,c)};
oidc.callback()(req,res,next);
})
@rodmcnew
rodmcnew / windows-apple-touchpad-driver
Last active December 25, 2020 00:47
How to Windows
Go to github releases, download, unzip, right click and click "install".
https://github.com/imbushuo/mac-precision-touchpad
#from https://apple.stackexchange.com/questions/159548/prevent-auto-pairing-for-certain-devices-bluetooth
#mac address from sudo defaults read /Library/Preferences/com.apple.Bluetooth.plist DeviceCache
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices -array-add 88-d0-39-c3-ee-31
@rodmcnew
rodmcnew / just call the acl service.ts
Last active June 18, 2019 16:27
loopback 4 ACL possible implementations usage
import {
Filter, repository,
} from '@loopback/repository';
import {
get,
getFilterSchemaFor,
HttpErrors,
param,
Request,
RestBindings,
<?php
class KeepAliveStream implements \Psr\Http\Message\StreamInterface
{
protected $doneMessage;
protected $keepAliveMessage;
protected $isDone = false;
public function __construct($keepAliveMessage = '.', $doneMessage = 'Done.')
{
@rodmcnew
rodmcnew / Bank Net Balance Bookmarklet
Last active June 29, 2018 23:26
Bank Net Balance Bookmarklet
javascript:(function () { function getValue(selector) { return document.querySelector(selector) .innerHTML.replace('$', '').replace(',', '') } alert(Math.round(getValue('#DepositAccountsTable .accountRowLast') - getValue('#CreditsTable .accountRowLast'))); })();
@rodmcnew
rodmcnew / RendererMustache.php
Created April 30, 2018 17:43
How to make RCM support jsonStringify mustache lambda.
<?php
namespace Rcm\Block\Renderer;
use Rcm\Block\Config\Config;
use Rcm\Block\Config\ConfigRepository;
use Rcm\Block\InstanceWithData\InstanceWithData;
class RendererMustache implements Renderer
{
@rodmcnew
rodmcnew / socks-ssh-tunnel.bash
Created July 17, 2017 18:15
socks-ssh-tunnel.bash
#Fill in these two vars and then set this script to run every minute in cron
REMOTE_HOST="somewhere.com"
LOCAL_PORT="12345"
#Leave this part alone
SSH_ARGS="$REMOTE_HOST -D $LOCAL_PORT -f -C -q -N"
START_COMMAND="ssh $SSH_ARGS"
echo ""
echo "Start command:"
echo $START_COMMAND
<script>
var testData = JSON.parse('{"m1":{"n":100,"d":82,"w":{"0":-1.1459447899883408,"1":-0.43760018570338904,"2":-0.007912300055782289,"3":-0.7775195174649078,"4":-0.9506407588688986,"5":-0.968010860301908,"6":-2.691807922209082,"7":-0.7431428809376434,"8":-1.5005473247243273,"9":-1.1238916004732475,"10":-0.34714691839944173,"11":0.30981333481408,"12":2.06758659398065,"13":-0.17417269832816004,"14":2.7456379240225486,"15":-0.676815649332452,"16":-2.309467615365306,"17":-2.341013203261767,"18":-1.6477384673749218,"19":-0.13356181468961806,"20":0.5181641866009631,"21":0.4362678106428555,"22":0.6827575787588762,"23":1.1358291360377544,"24":0.5452701986935545,"25":2.099832304806032,"26":0.03848688361846758,"27":1.7635262899682158,"28":2.644560543014539,"29":2.739290274928228,"30":0.8032392854292526,"31":-1.9310798293188054,"32":-0.3086325669036704,"33":0.6428509078110665,"34":-0.2200382207693386,"35":-1.6599938011512325,"36":-0.3232515071583018,"37":-1.8415199880552184,"38":0.22430170963057436,"39":-1.236
@rodmcnew
rodmcnew / iframe-killa.js
Last active March 2, 2022 23:07
This is a bookmarklet that removes all iframes from the current page. Paste its code into a bookmark URL field. Click the bookmark to remove all iframes. Once started, it also removes newly spawned iframes every 100ms.
javascript:void(function(){setInterval(function(){document.querySelectorAll('iframe').forEach(function(element){console.log('Iframe Killa - Removing Element:', element);element.parentNode.removeChild(element)})},100)}());