Skip to content

Instantly share code, notes, and snippets.

View jcdavison's full-sized avatar
🎯
Focusing

John Davison jcdavison

🎯
Focusing
View GitHub Profile

assuming we have a create endpoint that has something like

 def create
    @candidate = Candidate.new(candidate_params)

    @candidate.user_id = current_user.id
    @candidate.save!

 respond_to do |format|
@jcdavison
jcdavison / remove_extra_heic.rb
Created November 4, 2022 18:41
remove duplicate heic from list of photos
require 'pry'
# get all file names
file_names = Dir.entries(".")
# .entries(".") is annoying as it will also return ".", ".." which will give us problems
complete_file_names = Dir.entries(".").select {|entry| File.file? entry }
# general logic
#
<script src="https://use.typekit.net/avi1fqd.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<script>
(function(d) {
var config = {
kitId: 'avi1fqd',
scriptTimeout: 3000,
async: true
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
def recursive_fib(n)
# code here
end
def iterative_fib(n)
# more code here
end
recursive_fib(5) == ? # a lightweight 'spec'...
@jcdavison
jcdavison / dev_bootcamp_relay_graphql_workshop.md
Last active April 14, 2016 21:17
dev_bootcamp_relay_graphql_workshop

Personal Intro and Context

@jcdavison
jcdavison / peace_of_mind_tshirts.md
Last active May 3, 2016 20:37
peace_of_mind_tshirts
@jcdavison
jcdavison / rails-react-relay-graphql-workshop.md
Last active March 20, 2018 18:58
Learn to use Rails with React - Relay - Graphql

Join me as I conduct a live tutorial walk through of how to use Facebook's GraphQl/Relay tools to conduct high performance client side cache management in the context of a Ruby on Rails server, React client side stuff(z) and a declarative, non-RESTful, api.

We will be using a live application, source code and tutorials that I've written.

Live Application Site

Source Code

@jcdavison
jcdavison / gist:a88834ccbb355f4f9aedec32bb7733ee
Last active April 7, 2016 01:31
Rails - React - GraphQl - Relay Workshop Tutorial and Code Resources.
@jcdavison
jcdavison / gist:8faaccff80b0f43090b5
Created January 22, 2016 06:15
basics_of_javascript.md
In order to answer the below, you should be able to talk in clear terms accurately about the below and
be able to write and run either in a browser or in a node terminal all the below.
- What is a function and how do you define it?
- How do you define and then at a later point call a function?
- What are arguments?
- What are some basic differences between string, objects and arrays?
- What is a return value?
- What is a key and what is a value in terms of a key value pair?
- What does index position in an array mean?