Skip to content

Instantly share code, notes, and snippets.

View thehashrocket's full-sized avatar
🏠
Working from home

Jason Shultz thehashrocket

🏠
Working from home
View GitHub Profile
import React from 'react';
import NavBar from '../Shared/NavBar';
const { useState, useEffect } = React;
import useToken from '../useToken';
import reqwest from "reqwest";
import { useHistory, useParams } from 'react-router-dom';
import { Col, Layout, Row, Button, Form, Input, Modal, Rate, notification, Image, Divider, Alert, Space } from 'antd';
import LoadingSpinner from './../Shared/LoadingSpinner/LoadingSpinner';
import reviewNewStyles from './ReviewNew.module.css';
import { reviewStore } from '../../context/Store';
queueCreator = () => {
const queue = []
return {
add(x) {
queue.unshift(x)
},
remove() {
if (queue.length === 0) {
return undefined
}
@thehashrocket
thehashrocket / setup-rbenv.sh
Last active January 17, 2019 15:01
setup-rbenv.sh
#!/bin/bash
set -ex
brew update
brew install rbenv ruby-build
rbenv install 2.5.3
echo "export GEM_HOME=$HOME/gems" >> ~/.zshrc
echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.zshrc
source ~/.zshrc
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

Keybase proof

I hereby claim:

  • I am thehashrocket on github.
  • I am hashrocket (https://keybase.io/hashrocket) on keybase.
  • I have a public key ASDADXXfvya7POvUWtSmzptcd7ewTIJ1ZV5Mcrbsoqo5bAo

To claim this, I am signing this object:

@thehashrocket
thehashrocket / Create iOS Icons.jsx
Last active November 27, 2017 01:27 — forked from twonjosh/Create iOS Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
# config/routes.rb
get '/users/sign_in', to: redirect('/')
get '/users/sign_up', to: redirect('/')
devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" }
# app/models/user.rb
class User < ActiveRecord::Base
validates :approved_user, inclusion: [true]
class PagesController < ApplicationController
before_action :redirect_unless_live, only: [:cars, :trucks, :suvs]
def cars; end
def trucks; end
def suvs; end
home
# ready to go live
if registered and remote_app = RemoteApplications.find(app_id)
# do all the things
end
# or ...
if remote_app = RemoteApplications.find(app_id) and registered
# do all the things
end
# load from YAML for defaults
s3_config = YAML.load_file("#{Rails.root}/config/s3.yml")[Rails.env] || {}
# ENV variables take precedent
s3_config['aws_access_key_id'] = ENV['AWS_KEY'] if ENV['AWS_KEY']
s3_config['aws_secret_access_key'] = ENV['AWS_SECRET'] if ENV['AWS_SECRET']
s3_config['provider'] ||= 'AWS'
s3_config.symbolize_keys!
module Readable
extend ActiveSupport::Concerns
included do
after_commit :do_that_funky_thing
end
def do_that_funky_thing
self.columns_hash.each {|k,v| puts "#{v.type}"}
end