Skip to content

Instantly share code, notes, and snippets.

@hmps
hmps / gist:9f8881113457925d1869
Created June 23, 2014 14:58
The ProspectEye tracker - Simply put

Introduction to the ProspectEye tracker

The ProspectEye tracker is simply a small Javascript snippet that you put on your site. Once it is activated (that is, inserted into the markup of your site) it will track all visitors coming in and relay that information to ProspectEye's service.

Here's an example of what the code snippet looks like:

<script type="text/javascript">
    var psSite = "xxx"; var peJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
    document.write(unescape("%3Cscript src='" + peJsHost + "tr.prospecteye.com/track.js' type='text/javascript'%3E%3C/script%3E"));
</script>
@hmps
hmps / bookmarklet.js
Last active August 29, 2015 14:05
ProspectEye Support Bookmarklet
// THE RIDDLE
(function() {
if ( !!document.getElementById('ProspectEyeDebugger') ) {
document.getElementById('ProspectEyeDebugger').remove();
}
function styleEl(el, styles) {
for( var style in styles) {
if ( styles[style].length === 2 ) {
javascript: (function() {
var root = $(document.getElementsByTagName('html'));
var watchers = [];
var attributes = [];
var attributes_with_values = [];
var elements = [];
var elements_per_attr = [];
var scopes = [];
@hmps
hmps / Blur body
Last active August 29, 2015 14:11
UX testing bookmarklets
(function(d) {
var style = document.querySelector('#hmpsBlurStyle'),
body;
if ( style ) {
style.parentElement.removeChild(style);
} else {
body = d.querySelector('body');
style = d.createElement('style');
@hmps
hmps / .eslintrc
Last active September 4, 2015 12:01
ESLint configuration
{
"parser": "babel-eslint",
"rules": {
"indent": [ 2, 4 ],
"quotes": [ 2, "single" ],
"linebreak-style": [ 2, "unix" ],
"semi": [ 2, "always" ],
"func-names": 2,
"comma-style": 2,
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
@hmps
hmps / jspm-semver.md
Created September 11, 2015 12:39
JSPM semver rules

VERSIONING WITH JSPM & SEMVER

I've struggled a little with versioning in JSPM. It adheres to SemVer but does not support everything that NPM does. Here are the rules:

SPECIFIC VERSION

Installs only exactly the version given.

angular@1.0.0 => Only installs version 1.0.0 of angular
angular@1.4.3 =&gt; Only installs version 1.4.3 of angular
@hmps
hmps / controller.js
Created September 17, 2015 12:54
Select
;(function(angular) {
'use strict';
/* globals angular */
/* jshint latedef: false */
/**
* @module Apsis.modules.select
* @name SelectController
*
* @description Controller for the select.directive
@hmps
hmps / README.md
Last active March 4, 2016 07:57
Git flow finish with bash

Setup

  1. Put finish.sh (see below) in your repo root.
  2. Make finish.sh executable: $ chmod u+x finish.sh

If you want to have easy access to it without having to the script it in every repo you can save it somewhere safe and alias it. Something like this:

  1. Save to ~/finish.sh. Make it executable. (chmod +x finish.sh)
  2. Create an alias by adding alias finish='bash ~/finish.sh'. Make your alias whatever you want. Just remember it. :)

Feature

@hmps
hmps / gor.sh
Created January 13, 2016 12:15
Open Git remote url in Safari
#!/bin/bash
#
# Usage
# 1. Put this file somewhere safe in your file system
# 2. Make sure it is executable: chmod +x gor.sh
# 3. Create an alias in your CLI.
#
# Example alias:
# alias gor='bash ~/.cli-scripts/gor.sh';
@hmps
hmps / sv_SE.json
Created March 23, 2016 21:04
Keyboard localization for MBP SE Pro Layout
{
"48": {
"shifted": 61,
"alted": 125
},
"49": {
"shifted": 33
},
"50": {
"shifted": 34,