Skip to content

Instantly share code, notes, and snippets.

View thevangelist's full-sized avatar
⛩️

thevangelist

⛩️
  • Taitopilvi
  • 0.98327 - 1.017 AU
View GitHub Profile
@thevangelist
thevangelist / version.sh
Created September 30, 2016 08:45
Semver versioning with git tags & npm version
#!/bin/sh
# Convenience script for versioning
# Pass a semver-formatted version number to this script such as `npm version 2.1.0`.
#
# You'll get:
# 1) git tag such as v2.1.0
# 2) new version to `package.json`
npm version $1
@thevangelist
thevangelist / convert-to-kebab-case.js
Created September 21, 2016 10:11
JS: convert to kebab-case
const convertToKebabCase = (string) => {
return string.replace(/\s+/g, '-').toLowerCase();
}
@thevangelist
thevangelist / extends.scss
Created September 8, 2016 12:37
How to compose with SCSS ($extend property)
.message {
border: 1px solid #ccc;
padding: 10px;
color: #333;
}
.success {
@extend .message;
border-color: green;
}
<meta name="viewport" content="minimal-ui, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="App">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" sizes="57x57" href="favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="favicons/apple-touch-icon-120x120.png">
$static: './assets';
.television {
background: url(#{$img}/gray-noise.png);
}
@thevangelist
thevangelist / my-component.spec.js
Created August 4, 2016 13:06
The only React.js component test you'll ever need (Enzyme + Chai)
import React from 'react';
import { shallow } from 'enzyme';
import MyComponent from '../src/my-component';
const wrapper = shallow(<MyComponent/>);
describe('(Component) MyComponent', () => {
it('renders without exploding', () => {
expect(wrapper).to.have.length(1);
});