Skip to content

Instantly share code, notes, and snippets.

/* eslint-disable no-undef */
import { useEffect, useState, useRef } from 'react';
const useAutocomplete = () => {
// By using the `set` method of the `useState` hook, we can coax this into being `callback ref`
// contained inside of the hook.
const [autocompleteRef, setAutocompleteRef] = useState(null);
// We will return the formatted address with this const.
const [autocompletedAddress, setAutocompletedAddress] = useState(null);
// We only want one instance of the google places autocomplete method called using our callback
# brew install go
# go get github.com/arsham/figurine
# golang
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# bash greeting
figurine coverhound
//
// ViewController.swift
// Trailer
//
// Created by Cody Lopez on 1/18/18.
// Copyright © 2018 Cody Lopez. All rights reserved.
//
import UIKit
import Mapbox
{
"workbench.colorTheme": "One Dark Pro",
"files.autoSave": "onFocusChange",
"editor.fontSize": 14,
"editor.fontFamily": "Fira Code",
"editor.tabSize": 2,
"editor.fontLigatures": false,
"editor.renderWhitespace": "all",
"files.insertFinalNewline": true,
"search.exclude": {
<app-map [center]="center" [shops]="shops"></app-map>
<app-map-list [shops]="shops"></app-map-list>
@codyeatworld
codyeatworld / djangogen.sh
Last active April 6, 2018 17:46
Generate django projects
# Usage:
# djgen <project_name> <app_name>
# Parameters:
# $1 <project_name>
# $2 <app_name>
djgen() {
echo "👟 [Running] django-admin startproject $1"
django-admin startproject $1
@codyeatworld
codyeatworld / simple_form_bootstrap.rb
Created November 27, 2015 17:55
Changes to the simple form initializer for bootstrap 4 alpha
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.error_notification_class = 'alert alert-danger'
config.button_class = 'btn btn-primary'
config.boolean_label_class = nil
config.wrappers :vertical_input_group, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
b.use :html5
b.use :placeholder
b.use :label, class: 'form-control-label'
@codyeatworld
codyeatworld / add_file_to_printnode_queue.rb
Last active November 18, 2015 12:07
easypost_printnode_slack.rb
# app/services/add_file_to_printnode_queue.rb
require 'printnode'
class AddFileToPrintnodeQueue
def self.call(file_url, title, printer_name, file_type='pdf_uri')
# Connect to the API and setup a Client object.
auth = PrintNode::Auth.new(ENV['printnode_api_key'])
client = PrintNode::Client.new(auth)
module Permissions
class AdminPermission < BasePermission
def initialize(user)
allow_all
end
end
end
module CurrentCheckout
extend ActiveSupport::Concern
included do
before_action :set_current_checkout
end
private
def set_current_checkout