Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
OliverJAsh / foo.md
Last active Aug 29, 2015
`git stash pop` not merging
View foo.md

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 Aug 29, 2015
The Plumber equivalent of the Gruntfile from https://github.com/Mixd/frontend-framework
View Plumbing.js
// 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 Apr 12, 2014
Uncompress a HTTP response when needed
View foo.js
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
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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">
View a.rb
@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 Jun 21, 2014
CSS tooling: implicit style dependencies
View inheritance.css

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 Jul 25, 2014
Virtual DOM experiment for Scribe
View TODO
Broken deps:
* vdom => global
* global => min-document
@OliverJAsh
OliverJAsh / README.md
Last active Aug 29, 2015
longjohn interoperability with Traceur call stacks
View README.md
npm install
node traceur-runner.js main.js
View README.md
jspm install
npm i http-server
./node_modules/.bin/http-server -c-1 -o -p 8081
View README.md
npm install
./node_modules/.bin/traceur --out out.js test.js

node main.js