Skip to content

Instantly share code, notes, and snippets.

View trotzig's full-sized avatar

Henric Trotzig trotzig

View GitHub Profile
@trotzig
trotzig / .importjs
Created December 10, 2014 20:00
Example .importjs configuration with `lookup_paths`
lookup_paths:
- 'app/assets/javascripts'
- 'vendor/bower_components'
@trotzig
trotzig / .importjs
Created December 10, 2014 19:58
Example of an `aliases` configuration for Import-js
aliases:
'$' => 'third-party-libs/jquery'
'_' => 'third-party-libs/underscore'
describe('Button', () => {
subject(() => {
return React.addons.TestUtils.renderIntoDocument(
<Button {...this.lets['props']} />
);
});
describe('with a `text` prop', => {
let('props', { text: 'Click me'});
describe('Button', () => {
describe('with a `text` prop', => {
it('renders the text', () => {
var button = React.addons.TestUtils.renderIntoDocument(
<Button text="Click me" />
);
expect(button).toHaveText('Click me');
});
describe('and an `icon` prop', () => {
@trotzig
trotzig / subject-pattern.js.jsx
Last active August 29, 2015 14:10
An example of the `subject` pattern for DRYer Jasmine specs
describe('Button', () => {
beforeEach(() => {
this.subject = () => {
return React.addons.TestUtils.renderIntoDocument(
<Button {...this.props} />
);
};
});
describe('with a `text` prop', => {
# Converts global chained `var`s into single-line vars.
#
# Example:
#
# >> cat test.js
# var A = require('a'),
# B = require('b'),
# C = B.C;
#
# var D = function() {};
@trotzig
trotzig / SassMeister-input-HTML.html
Last active August 29, 2015 14:07
Generated by SassMeister.com.
<div class="bike">
<div class="wheel wheel--front">
<div class="spoke spoke--0"></div>
<div class="spoke spoke--1"></div>
<div class="spoke spoke--2"></div>
<div class="spoke spoke--3"></div>
<div class="spoke spoke--4"></div>
</div>
<div class="wheel wheel--back">
<div class="spoke spoke--0"></div>
@trotzig
trotzig / SassMeister-input-HTML.html
Created October 5, 2014 08:31
Generated by SassMeister.com.
<div class="bike">
<div class="wheel wheel--front">
<div class="spoke spoke--0"></div>
<div class="spoke spoke--1"></div>
<div class="spoke spoke--2"></div>
<div class="spoke spoke--3"></div>
<div class="spoke spoke--4"></div>
</div>
<div class="wheel wheel--back">
<div class="spoke spoke--0"></div>

Keybase proof

I hereby claim:

  • I am trotzig on github.
  • I am henric (https://keybase.io/henric) on keybase.
  • I have a public key whose fingerprint is EC58 B9C8 9827 6856 7E00 B8A7 4C5B 3FD4 7166 FDEE

To claim this, I am signing this object:

/**
* We need to clear floats for the container so that it wraps
* the content nicely.
*
* Clearfix technique from http://nicolasgallagher.com/micro-clearfix-hack/
*/
.chip:before,
.chip:after {
content: " ";
display: table;