Skip to content

Instantly share code, notes, and snippets.

View hanford's full-sized avatar
🌝

Jack Hanford hanford

🌝
View GitHub Profile
@hanford
hanford / Companies.js
Created August 5, 2013 21:21
Companies.js
$(function() {
var hideAllPopovers = function() {
$('.shift-bar').each(function() {
$(this).popover('hide');
});
};
$('.shift-bar') .each(function() {
$(this).popover({
content: $('.shift-options', this).html(),
@hanford
hanford / CSS
Created August 5, 2013 20:29
Pin Entry!
#keypad {
margin:auto;
margin-top:20px;
}
#keypad tr td {
vertical-align:middle;
text-align:center;
border:1px solid #000000;
font-size:18px;
font-weight:bold;
publish () {
git fetch
if [[ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]]; then
return 1
fi
npm version $1 && git push origin --tags
}
const webpack = require('webpack')
const reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
}
const reactDOMExternal = {
this.state = {
isImgLoaded: false
}
const img = document.createElement('img')
img.onload = () => this.setState({
isImgLoaded: true
})
<Drag>
{({xDelta, yDelta}) => (
<div style={{transform: translateY(`${yDelta}px`)}}>
Hey, I'm getting dragged
</div>
)}
</Drag>
// before
<div
className={style.dragScroll}
style={{transform: `translateX(-${position}px)`}}
ref={c => this.setRef(c)}
>
{ref && <Kinetic allowScroll={direction !== 'y'} max={ref.offsetWidth - 200} direction='x' element={ref} broadcast={this.setPosition} />}
{children}
</div>
// before
<div
className={style.dragScroll}
style={{transform: `translateX(-${position}px)`}}
ref={c => this.setRef(c)}
>
{ref && <Kinetic allowScroll={direction !== 'y'} max={ref.offsetWidth - 200} direction='x' element={ref} broadcast={this.setPosition} />}
{children}
</div>
@hanford
hanford / circle.yml
Created November 15, 2017 07:42
now-cli + circle.yml
machine:
node:
version: 9
dependencies:
pre:
- npm i -g now-cli
deployment:
feature:
import { connect } from 'react-redux'
import pole from 'pole'
import React from 'react'
import Visibility from 'document-visibility'
const visibility = Visibility()
import { fetchUserProfile, fetchStatus } from 'www/redux/profile/actions'
import { fetchCard } from 'www/redux/checkout/actions'