Skip to content

Instantly share code, notes, and snippets.

View OliverJAsh's full-sized avatar

Oliver Joseph Ash OliverJAsh

View GitHub Profile
@OliverJAsh
OliverJAsh / foo.md
Last active August 29, 2015 13:57
`git stash pop` not merging

If you’re trying to pop a stash and Git won’t merge for you because you have changes in your index to the same file(s) (Git needs to use the index to do a merge at all), i.e.:

❯ gsp
error: Your local changes to the following files would be overwritten by merge:
	index.html
Please, commit your changes or stash them before you can merge.
Aborting
@OliverJAsh
OliverJAsh / Plumbing.js
Last active August 29, 2015 13:57
The Plumber equivalent of the Gruntfile from https://github.com/Mixd/frontend-framework
// https://github.com/plumberjs/plumber
var all = require('plumber-all');
var glob = require('plumber-glob');
var bower = require('plumber-bower');
var uglifyjs = require('plumber-uglifyjs')();
var concat = require('plumber-concat');
var filter = require('plumber-filter');
var mincss = require('plumber-mincss');
var rename = require('plumber-rename');
@OliverJAsh
OliverJAsh / foo.js
Created April 12, 2014 14:21
Uncompress a HTTP response when needed
var request = require('request');
var stream = require('stream');
var zlib = require('zlib');
var websiteRequest = request('http://oliverjash.me/', {
headers: {
'Accept-Encoding': 'gzip,deflate'
}
});
@OliverJAsh
OliverJAsh / SassMeister-input-HTML.html
Created May 9, 2014 16:11
Generated by SassMeister.com.
<div class="l-row l-desktop-row">
<div class="l-desktop-row__item flex-2">
<section class="island">
<h1>We build in pursuit of a cause that is greater than ourselves.</h1>
<div class="l-row l-tablet-row l-tablet-row--max-2">
<div class="l-tablet-row__item">
<section class="island">
<h1 class="h3">Empowering journalists</h1>
<p>We build products that make it easier for journalists to publish informative and delightful stories.</p>
<div class="l-row l-default-row l-default-row--max-2">
@mixin font-size($percent, $min-font-size, $max-font-size) {
// Min
font-size: $min-font-size;
@include breakpoint($min-font-size/$percent * 100) {
font-size: #{$percent}vw;
}
@include breakpoint($max-font-size/$percent * 100) {
font-size: $max-font-size;
@OliverJAsh
OliverJAsh / inheritance.css
Created June 21, 2014 13:12
CSS tooling: implicit style dependencies

I see this quite often in CSS: something doesn't look right, so we apply some new styles on our class to make it look right.

Instead we need to review what the current styles are, and where they come from – another class (composition) or inheritance. If you’re changing the font-family style, for example, you should have a look to see what might be currently setting that property in the styles pane, and identify how it’s cascading to this element. It may be that you can remove it from a parent element, or you might need to override it with a class. Without reviewing the code is this way, you CSS codebase can easily become bloated with style overrides.

Chrome DevTools makes reviewing the cascade very easy with its styles pane. However, when you look at some CSS code in your IDE, it’s not at all explicit what styles will be inherited or applied through composition. This means we have to have strong discipline in documenting our CSS – where you’re unsetting or resetting a style that is inherited, you might le

@OliverJAsh
OliverJAsh / TODO
Created July 25, 2014 12:16
Virtual DOM experiment for Scribe
Broken deps:
* vdom => global
* global => min-document
@OliverJAsh
OliverJAsh / README.md
Last active August 29, 2015 14:08
longjohn interoperability with Traceur call stacks
npm install
node traceur-runner.js main.js
@OliverJAsh
OliverJAsh / README.md
Created October 30, 2014 11:56
jspm test
jspm install
npm i http-server
./node_modules/.bin/http-server -c-1 -o -p 8081
@OliverJAsh
OliverJAsh / README.md
Created October 30, 2014 16:31
Traceur error
npm install
./node_modules/.bin/traceur --out out.js test.js

node main.js