Skip to content

Instantly share code, notes, and snippets.

View JamieMason's full-sized avatar
💤
On a break from OSS for a couple of weeks

Jamie Mason JamieMason

💤
On a break from OSS for a couple of weeks
View GitHub Profile
@JamieMason
JamieMason / inuit-variables.scss
Created February 11, 2014 13:18
All matches for \$[a-z\-]+\b in inuit.css v5.0
/*------------------------------------*\
$OVERRIDES
$animation-name : $english-quotes : $responsive : $palm-pull
$arrow : $font-size : $responsive-extra : $palm-push
$arrow-border : $from : $state : $portable-pull
$arrow-color : $giga-size : $to : $portable-push
$arrow-edge : $global-border-box : $truncation-boundary : $property
$arrow-location : $half-spacing-unit : $use-arrows : $pull
$arrow-size : $i : $use-beautons : $push
@JamieMason
JamieMason / inuit-classes.scss
Created February 11, 2014 17:00
All matches for \w?\.[a-z\-_]+[,\{] in inuit.css v5.0
/*
.accessibility .code-comment .informative .nav--stacked
.additional .delta .island .numbered-list
.all-cols .epsilon .islet .numerical
.alpha .extra-help .kilo .options
.beta .flexbox .label .pagination
.block-list .flexbox__item .landmark .pill
.block-list__link .flyout .lead .proceed
.brand .flyout--alt .lede .rule
.brand-color .flyout__content .line-numbers .rule--dashed
@JamieMason
JamieMason / gist:9051177
Last active August 29, 2015 13:56
Replace return statements in a JavaScript syntax tree
function replaceReturnedValue(returnStatement) {
returnStatement.type = 'ExpressionStatement',
returnStatement.expression = {
type: 'CallExpression',
callee: {
type: 'MemberExpression',
computed: false,
object: {
type: 'Identifier',
name: '_map'
@JamieMason
JamieMason / npm-scm.md
Created June 9, 2014 10:56
Question on git, npm, bower, and CI.

Hey, Probably a somewhat n00b question, but on sites of your size that build and release as often as yours do - how do you manage your npm and bower packages? Currently we .gitignore our node_modules and bower_components directories, but I feel we should break that SPOF we have with npm and bower's servers, in the event they're unavailable when our CI is running a build/release.

I had considered checking the packages into git, but;

  1. I'm sure this is frequently advised against [citation needed].
  2. Some packages such as karma-runner/karma-phantomjs-launcher perform a tailored installation for the OS npm install was run from (eg phantomjs for Windows if installed when on Windows) - so if developer A on Windows runs npm install and checks it into git, CI Server B on Linux will be failing builds.

Is this SPOF something you're even concerned about? And if so, how do you manage it please?

@JamieMason
JamieMason / linkedin-imported-contacts.md
Created July 30, 2014 06:54
LinkedIn.com imported contacts, filter out connections that do not have a LinkedIn account.

LinkedIn.com imported contacts, filter out connections that do not have a LinkedIn account.

Navigate to https://www.linkedin.com/people/contacts, open your browser Developer console and run;

[].forEach.call(document.querySelectorAll('li.vcard'), function(el) {
  if (!el.querySelector('span.in-icon')) {
    el.parentNode.removeChild(el);
  }
});
@JamieMason
JamieMason / domHighlightConfig.json
Created August 13, 2014 13:35
Chrome DevTools' internal config when highlighting the element the mouse is over in the Elements panel.
{
"showInfo": true,
"showRulers": false,
"showExtensionLines": false,
"contentColor": {
"r": 111,
"g": 168,
"b": 220,
"a": 0.66
},
@JamieMason
JamieMason / scope-depth.js
Created August 20, 2014 13:41
Get nesting/depth of an AngularJS $scope
function getDepth($scope) {
var depth = 0;
while ($scope.$parent) {
$scope = $scope.$parent;
depth++;
}
return depth;
}
console.log(
@JamieMason
JamieMason / run_e2e_tests
Created November 27, 2014 17:00
Run all CasperJS tests in a project using a glob file pattern.
#!/bin/bash
# Runs our end to end tests in casperjs.
# Run this script as follows from the project root;
#
# bin/run_e2e_tests
printf "\e[93m > SEARCHING FOR TEST FILES \033[0m \n"
find "$PWD" -iname "*.e2e.spec.js" -type f -print0 | while read -d '' -r file; do
@JamieMason
JamieMason / locations.js
Created April 2, 2015 09:11
Shrinkpack locations.js
'use strict';
module.exports = {
create: create
};
var path = require('path');
var terminal = require('terminal');
function create(options) {
@JamieMason
JamieMason / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console