Skip to content

Instantly share code, notes, and snippets.

Outline
Texas Holdem using Rails 5 action Cable
Intro
* Excited about Rails five's new feature action cable
* What it does
Action cable allows you to integrate websockets into your rails app for real time updates
Most examples are of chat applications. Wouldn't it be cool to have a poker app that updates in realtime
when other players take actions?
##Leap
My code: http://exercism.io/submissions/714b4da37a15469fb6090b0a6eb206d5
* user #1 ([here](http://exercism.io/submissions/08fb2ad5e90d4bda802530565c868752)) - This user solved the problem pretty much the same way I did. He used if / else conditionals; whereas, I used a the && and || operator. I also broke mine out into a separate function.
* user #2 ([here](http://exercism.io/submissions/7e61b46cf54a473b82fb0a5d919fa0c0)) - This user broke the problem out into two functions as well. Our approaches were very similar except he is evaluating local variables inside the method instead of evaluatng the result of the method call.
* user #3 ([here](http://exercism.io/submissions/3134dcfb07df4977b7a62ad3d9daafd8)) - This user handled the entire if / else condition. The option seems very straight forward and is easy to follow.
* user #4 ([here](http://exercism.io/submissions/d2ff8f9e1aad445cb5641647379d0d7e)) - I have not seen this syntax before "isLeap: function()" for defining a function. This code seems
@chadellison
chadellison / gist:b27901a7630ff0fe469bc45abf1714f9
Last active June 13, 2016 03:23
Helpful gems for rails projects
source 'https://rubygems.org'
#optional
# gem 'dropzonejs-rails' <-- for drag and drop photos
# Use SCSS for stylesheets
# gem 'faker'
# gem "chartkick"
# gem 'foundation-rails' <-- for foundation styling
# gem 'foundation-icons-sass-rails'
# gem 'stripe'
@chadellison
chadellison / index.css
Created May 16, 2016 15:17 — forked from neight-allen/index.css
Example code used for a Turing lesson about basic jQuery DOM traversal and manipulation
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600);
body {
background-color: white;
font-family: "Open Sans", Helvetica, sans-serif;
font-size: 12px;
}
td, th {
padding: 0.5em;
@chadellison
chadellison / chad_ellison_lightning_talk.md
Created February 2, 2016 22:31
AI: bridging the gap

Artificial Intelligence: Bridging the Gap

AI and pop culture

  • I've always been fascinated with the nature of intelligence, and naturally, AI.
  • films like "her" and "Ex Machina" give a very compelling performance of a person playing a machine that is playing a person
  • It really is astounding what machines are capable of.
  • It's hard not to ask how close we are to manufacturing genuine intelligence.

The greatest barrier

  • The greatest barrier to manufacturing intelligence as we know it is what might be called a rational volition
@chadellison
chadellison / cfu_crud_in_sinatra.markdown
Created February 2, 2016 20:15 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD.
  2. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
  3. Why do we use set method_override: true?
  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.
  5. What are params? Where do they come from?