Skip to content

Instantly share code, notes, and snippets.

@hmps
hmps / keybase.md
Created June 2, 2016 09:58
keybase.md

Keybase proof

I hereby claim:

  • I am hmps on github.
  • I am hmps (https://keybase.io/hmps) on keybase.
  • I have a public key ASBSOgH3wxwdxRD1tHLgpa0PxQJeRPlgkabedy2jddaV7wo

To claim this, I am signing this object:

@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,
@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 / 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 / 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 / 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.

[email protected] => Only installs version 1.0.0 of angular
[email protected] => Only installs version 1.4.3 of angular
@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 / 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');
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 / 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 ) {