Skip to content

Instantly share code, notes, and snippets.

@klzns
klzns / gist:5066139
Last active December 14, 2015 09:38 — forked from tzi/index.html
Detect Internet Explorer version in Coffeescript. Returns IE version number if true, otherwise returns false.
window.dammitIE = do ->
is_internet_explorer = ->
window.navigator.appName is "Microsoft Internet Explorer"
get_internet_explorer_version = ->
matches = new RegExp(" MSIE ([0-9].[0-9]);").exec(window.navigator.userAgent)
return parseInt(matches[1].replace(".0", "")) if matches? and matches.length > 1
true
@klzns
klzns / ReactSVGWebpackExample.jsx
Last active August 29, 2015 14:27 — forked from MoOx/svgicon.css
Adding SVG icons with React + webpack
import React from 'react';
import SVGIcon from 'components/utils/SVGIcon';
import myIcon from 'assets/icons/myicon.svg';
class MyComponent extends React.Component {
render() {
return (
<div>
<SVGIcon svg={myIcon} width={18} height={18} fill="#444"/>
</div>