Skip to content

Instantly share code, notes, and snippets.

View phdesign's full-sized avatar

Paul Heasley phdesign

View GitHub Profile
@phdesign
phdesign / analysis.js
Created May 23, 2018 07:13
Parse a webpack json output to compute size of our files vs. depedendencies
const buildStats = require('./build.json');
function getSize(modules) {
return modules.reduce((acc, val) => acc + val.size, 0);
}
const tpl = (type, modules) => `${type} files
--------
no. of modules: ${modules.length}
total size: ${Math.round(getSize(modules) / 1000)} KB`
@phdesign
phdesign / App.xaml.cs
Last active July 20, 2017 22:20
Redux.NET Middleware to persist Actions to LiteDb
public App()
{
InitializeComponent();
var dbPath = DependencyService.Get<IFileHelper>().GetLocalFilePath("todo.db");
var persistActionsMiddleware = new PersistActionsMiddleware<ApplicationState>(dbPath);
Store = new Store<ApplicationState>(
Reducers.Reducers.ReduceApplication,
new ApplicationState(),
persistActionsMiddleware.CreateMiddleware());
@phdesign
phdesign / inject-jquery.js
Last active June 9, 2017 01:01
Inject jQuery onto page bookmarklet
javascript: (function(url) {
var script = document.createElement("script");
script.setAttribute("src", url);
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
console.log('jQuery injected');
}, false);
document.body.appendChild(script);
})('//code.jquery.com/jquery-latest.min.js')
(*
This Apple script will resize any program window to an exact size and the window is then moved to the center of your screen.
Specify the program name, height and width below and run the script.
Written by Amit Agarwal on December 10, 2013
*)
set theApp to "Google Chrome"
@phdesign
phdesign / README.md
Last active December 9, 2015 03:38 — forked from warnergodfrey/Gemfile
Instructions for running remote JMeter

Instructions for running remote JMeter

Server

Create a AWS instance

aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type m1.medium --key-name MyKeyPair --security-groups MySecurityGroup
@phdesign
phdesign / .jshintrc
Created November 9, 2015 09:48
Using Grunt with pebble build
/*
* Example jshint configuration file for Pebble development.
* Adapted from http://developer.getpebble.com/blog/2014/01/12/Using-JSHint-For-Pebble-Development/
*
* Check out the full documentation at http://www.jshint.com/docs/options/
*/
{
// Declares the existence of a global 'Pebble' object
"globals": { "Pebble" : true },