Skip to content

Instantly share code, notes, and snippets.

Sean Roberts SeanRoberts

  • Hamilton, Ontario
View GitHub Profile
View phash.sh
#!/bin/sh
#
#
# Download required libraries
cd ~
mkdir download
cd download
View gist:ab2173146b47442cc9cf00eaf4236c32
Tuning: Standard
e|-----------------------------------6-6---5-5---|
B|-----------------------------------6-6---6-6---|
G|--5p3------------------------------7-7---5-5---|
D|-------5---------------------------------------|
A|----------6b--3~--------3-----3----------------|
E|------------------3h5------5-------------------|
View Filters.jsx
import React from 'react';
import { debounce } from 'lodash';
import PropTypes from 'prop-types';
export default class Filters extends React.Component {
static propTypes = {
initialFilters: PropTypes.objectOf(PropTypes.string),
render: PropTypes.func.isRequired,
afterChange: PropTypes.func,
};
View gist:e2a33e586e027d0144e85a34319f451b
export const doLogin = (email, password) => {
return (dispatch) => {
dispatch({ type: START_LOGIN });
fetch(myLoginUrl, { email, password })
.then(() => dispatch({ type: LOGIN_SUCCESS }))
.catch((err) => dispatch({ type: LOGIN_FAILURE, err: err }))
}
}
@SeanRoberts
SeanRoberts / delayed_job.conf
Created Sep 20, 2016
Upstart script for delayed job using rbenv and bundle exec
View delayed_job.conf
start on runlevel [2345]
stop on runlevel [06]
setuid YOUR_USER
setgid YOUR_USER
env HOME=/home/YOUR_USER
env RAILS_ENV=production
env PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:/usr/local/bin:/usr/bin:/bin
chdir /path/to/your/app
exec $HOME/.rbenv/bin/rbenv shell 2.1.0
View gist:0ab8380bb6b269b7d67554f81171573e
render() {
let viewApplicantsButton = <noscript />;
if (record.applicants.length && !record.offer && !record.hiree) {
viewApplicantsButton = (
<div className="record__details-item record__details-item--final">
<button
className="record__action"
onClick={() => this._toggleApplicantList()}>
{this.state.isApplicantListOpen ? 'Hide ' : 'View '}
View marker.es6
class Marker extends React.Component {
componentDidMount() {
const { lat, lng } = this.props.spot;
this.gMarker = new RichMarker({
position: new google.maps.LatLng(lat, lng),
map: this.props.gMap,
draggable: true,
content: ReactDOM.findDOMNode(this)
});
View gist:55581c18fab89fcc8537e3f3ec4f7339
devise_for(
:users,
only: :sessions,
controllers: { sessions: 'devise/sessions' }
)
constraints MainAppConstraint.new do
devise_for(
:users,
skip: :sessions,
View gist:e4e52d9773989b99189c
export const toggleModalForm = (to) => {
if (to === 'on') {
Tenon.features.ModalWindows.prepBodyForModal();
} else {
Tenon.features.ModalWindows.clearBody();
}
return {
type: types.TOGGLE_MODAL_FORM,
to: to
View app.js
import * as actions from './actions/index'
// ...
You can’t perform that action at this time.