Skip to content

Instantly share code, notes, and snippets.

View jonleopard's full-sized avatar
ಠ_ಠ

Jon Leopard jonleopard

ಠ_ಠ
View GitHub Profile
@jonleopard
jonleopard / gist:3995775
Created November 1, 2012 19:11 — forked from padolsey/gist:527683
Javascript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
{
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"plugins": [
"prettier"
],
"rules": {
" ----------------------------------------------------------------------------
" ale
" ----------------------------------------------------------------------------
nmap <leader>p <Plug>(ale_fix)
"let g:ale_lint_on_save = 1
"let g:ale_fix_on_save = 1
let g:ale_completion_enabled = 1
let g:ale_linters = {
\ 'javascript' : ['eslint', 'flow'],
\ 'html' : ['htmlhint', 'tidy'],
@jonleopard
jonleopard / App.js
Last active January 30, 2018 16:46
import React from 'react';
import Popular from './Popular';
import { BroswerRouter, Route } from 'react-router-dom';
import Nav from './Nav';
import Home from './Home';
import Battle from './Battle';
class App extends React.Component {
render() {
return (
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@jonleopard
jonleopard / keybase.txt
Last active March 23, 2018 21:18
keybase.md
### Keybase proof
I hereby claim:
* I am jonleopard on github.
* I am jonleopard (https://keybase.io/jonleopard) on keybase.
* I have a public key whose fingerprint is B736 4543 FBB5 DE1A 2496 E926 A475 0F00 D5A2 5EDC
To claim this, I am signing this object:
@jonleopard
jonleopard / gatsby-node.js
Created March 30, 2018 16:56 — forked from resir014/gatsby-node.js
Simulate Jekyll's page generation on Gatsby!
// @ts-check
// Requires module: slug, gatsby-source-filesystem
const path = require('path')
const slugify = require('slug')
const { createFilePath } = require('gatsby-source-filesystem')
// Regex to parse date and title from the filename
const BLOG_POST_SLUG_REGEX = /^\/blog\/([\d]{4})-([\d]{2})-([\d]{2})-(.+)\/$/
@jonleopard
jonleopard / normalize.js
Created April 5, 2018 06:49
Some examples for injectGlobal
// Normalize.css
import { injectGlobal } from 'styled-components'
import styledNormalize from 'styled-normalize'
injectGlobal`
${styledNormalize}
`
// //
// Notes on React.js //
// //
// ES6 Arrow Function
// This is a functional component
const App = () => {
return <h1>Hello World</h1>
};
{
"ecmaVersion": 6,
"libs": [
"browser"
],
"loadEagerly": [
"path/to/your/js/**/*.js"
],