Instantly share code, notes, and snippets.

View uber_history.go
/**
* A Go script that pulls Uber ride history and fare details
*
* Example:
* $ go run concurrent_http.go
*
* New York | Base: $1.16 -- Duration Cost: $2.32 -- Distance Cost (mile): $4.53 -- Service Fees: $2.35 -- Duration: 13.67min
* New Jersey | Base: $1.16 -- Duration Cost: $0.66 -- Distance Cost (mile): $1.83 -- Service Fees: $2.35 -- Duration: 3.88min
* New Jersey | Base: $1.10 -- Duration Cost: $0.86 -- Distance Cost (mile): $1.94 -- Service Fees: $2.20 -- Duration: 5.40min
* New Jersey | Base: $1.10 -- Duration Cost: $2.38 -- Distance Cost (mile): $1.47 -- Service Fees: $2.20 -- Duration: 14.87min
View purge-css-cloudflare.sh
#!/usr/bin/env bash
# Author: Pat Migliaccio <pat@patmigliaccio.com>
# License: MIT
# Uses Bash 4 syntax
declare -A config
config=(
[email]="<Acct_Email>"
[zone]="<Zone_ID>"
View keybase.md

Keybase proof

I hereby claim:

  • I am patmigliaccio on github.
  • I am patmigliaccio (https://keybase.io/patmigliaccio) on keybase.
  • I have a public key ASCBxsyiCy5TXXNF83e18qN1B-1Ya9YD6ow6XsOVnGxcIgo

To claim this, I am signing this object:

View concurrent_http.go
/**
* A quick Go script, testing the performance of using
* concurrent channels for HTTP requests.
*
* Example:
* $ go run concurrent_http.go https://google.com https://facebook.com
*
* -- Consecutive --
* GET: https://google.com
* 0.61 elapsed with response length: 10711 https://google.com
View rdp-azure.sh
#!/bin/sh
# RDP into Azure VM / Windows machine using `xfreerdp`
#
# Reference: https://github.com/FreeRDP/FreeRDP/issues/2128#issuecomment-213505787
#
# Required dependency: http://www.freerdp.com/
#
# Preferred over `rdesktop` due to: https://github.com/rdesktop/rdesktop/issues/71
View prettier-git-config.sh
#!/bin/sh
# Reference: https://medium.com/millennial-falcon-technology/reformatting-your-code-base-using-prettier-or-eslint-without-destroying-git-history-35052f3d853e
git filter-branch --tree-filter 'prettier --config ../../.prettierrc --write "src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}" || echo "formatting error"' -- --all
View rdp.sh
#!/bin/sh
# Reference: https://stackoverflow.com/a/38860/5199198
SERVER=SERVER_NAME
USER=USER_NAME
DOMAIN=DOMAIN_NAME
/usr/bin/rdesktop -g 1152x864 \
-a 16 \
View gistList.js
(function (window, document, undefined) {
'use strict';
/**
* Configuration for Gist List
*/
const gistPage = 'stash',
username = 'patmigliaccio',
gistCount = 5,
excludeIfDescriptionContains = 'patmigliaccio.com',
View client-side-security-svg.js
function requestGeneratedSVG(){
return xhr('/assets/css/svg/generate')
.then(response => {
let content = parseSVGResponse(response.data);
// Decoded sensitive data would be handled here.
return JSON.parse(atob(content));
});
}
View client-side-security-svg-deobfuscated.js
var a = ["data", "parse", "then", "/assets/css/svg/generate", "", "split", "trim", "pop", "unshift", "forEach", "join"];
function requestGeneratedSVG() {
return xhr('/assets/css/svg/generate')['then'](function(b) {
let c = parseSVGResponse(b['data']);
return JSON['parse'](atob(c))
})
}
function parseSVGResponse(d) {