Skip to content

Instantly share code, notes, and snippets.

View SeanRoberts's full-sized avatar

Sean Roberts SeanRoberts

View GitHub Profile
alias co="git for-each-ref --sort=-committerdate refs/heads/ refs/remotes/ --format='%(refname:short)' | sed 's|^remotes/||' | fzf | xargs git checkout"
@SeanRoberts
SeanRoberts / modification.json
Created April 16, 2024 20:05
Karabiner Elements - CAPS_LOCK to HYPER (SHIFT+COMMAND+OPTION+CONTROL) or ESCAPE (If Alone)
{
"description": "CAPS_LOCK to HYPER (SHIFT+COMMAND+OPTION+CONTROL) or ESCAPE (If Alone)",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {}
},
"to": [
{
@SeanRoberts
SeanRoberts / phash.sh
Created November 16, 2019 01:14 — forked from jamesmontalvo3/phash.sh
Install phash
#!/bin/sh
#
#
# Download required libraries
cd ~
mkdir download
cd download
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-------------------|
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,
};
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 September 20, 2016 13:14
Upstart script for delayed job using rbenv and bundle exec
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
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 '}
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)
});
devise_for(
:users,
only: :sessions,
controllers: { sessions: 'devise/sessions' }
)
constraints MainAppConstraint.new do
devise_for(
:users,
skip: :sessions,