Skip to content

Instantly share code, notes, and snippets.

View michaelwehrley's full-sized avatar

Michael Wehrley michaelwehrley

  • Home Chef
  • Chicago
View GitHub Profile
@michaelwehrley
michaelwehrley / Makefile
Created March 14, 2016 21:52
Additional instructions to use cs50
# You can download cs50 library from https://manual.cs50.net/library/#mac_os_2 and follow the instructions to download.
# You will have to manually link (`-I /usr/local/include -L /usr/local/lib -lcs50 -lm` for the linking step of compilation to work)
# to the 'include' and 'lib' directories in your makefiles if you want to use the cs50 library.
#
# Makefile
#
# Computer Science 50
# Problem Set 3
#
# Example Makefile for Problem Set 3 below
class Board
attr_reader :cells
def initialize
@cells = []
(1..16).times do |n|
@cells << Cell.new
end
end
@michaelwehrley
michaelwehrley / name.rb
Created September 21, 2015 17:31
simple example of string interpolation
puts 'What\'s your favorite number?'
number = gets
puts "That's nice, but you should really consider #{number.to_i + 1}! It is a better number."
@michaelwehrley
michaelwehrley / CigaretteLogController.js
Last active September 2, 2015 15:53
refactoring 2 controllers into a log controller
this.CURRENTLY_SMOKING = 'currently_smoking';
this.SMOKING_REASON = 'smoking_reason';
this.URGE_STRENGTH = 'urge_strength';
this.SMOKING_REASONS = ['Reduce craving',
'Soon going where I can’t smoke',
'Cope with negative emotion',
'Enhance positive emotion',
'Habit/automatic',
'Opportunity to socialize',
'Break from work/studying',
@michaelwehrley
michaelwehrley / _comments.html.erb
Last active August 28, 2015 16:35
`allow(view)` not allowing view to implement message.
<div class="panel panel-default cdb_panel" id="comments-container">
<div class="panel-heading">
<h3 class="panel-title adjusted-panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#commentsCollapse">
Comments
</a>
</h3>
</div>
<div id="commentsCollapse" class="panel-collapse collapse in">
puts "hi joko"
class Namerizer
def initialize(participant)
@first_name = participant.first_name
@last_name = participant.last_name
end
def name
@first_name + @last_name
end
end
<html><head><style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}</style>
<meta charset="UTF-8">
<title>Think Feel Do</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link href="/assets/favicon-224f3092a68391acb671ccb4f43b409c.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<link data-turbolinks-track="true" href="/assets/engine-a4bc78e2b00abfd888581455cd058127.css" media="all" rel="stylesheet">
<link data-turbolinks-track="true" href="/assets/mobile-0b538811b226dc65d26d37266958f26c.css" media="all" rel="stylesheet">
<link data-turbolinks-track="true" href="/assets/think_feel_do_engine/print-1f22461df6f720e3fb2ad5f8e04c13b1.css" media="print" rel="stylesheet">
<script src="/assets/engine-b30b8b46b6f32f1ea0e33bc8ac6986ec.js"></script>
<meta content="authenticity_token" name="csrf-param">