Skip to content

Instantly share code, notes, and snippets.

View theotherzach's full-sized avatar

Zach Briggs theotherzach

View GitHub Profile

Paraphrased from the first few minutes of Lecture 1A | MIT 6.001 Structure and Interpretation, 1986

First of all, it's not a science.

It's not about computers in the same sense that physics is not about a particle accelerator. And Biology is not really about microscopes and petri dishes. And it's not about computers in the same sense that geometry is not really about using surveying instruments.

>In fact, there are a lot of commonalities between computer science and geometry. Geometry, first of all, is another subject with a lousy name. Geometry comes from Gaia which means the earth and metron which means to measure. Geometry originally meant measuring the earth or surveying. The reason for that is that 1000's of years ago the Egyptian priesthood developed the rudiments of geometry in order to restore the boundaries of fields that that were destroyed in the annual flooding. To the Egyptians who did that, geometry really was about surveying instruments.

optparse = OptionParser.new do |opts|
opts.banner = "Usage: ghpreview [options] FILE"
opts.separator ""
opts.on("-w", "--watch", "Watch for changes") do |w|
options[:watch] = w
end
opts.on("-a", "--application APP", "Alternate browser") do |a|
options[:application] = a
{{select_from StaffMember, all_except: timestamps}}
{{join_collection @finance_report.joins}}
WHERE
{{select_from EmploymentHistory, where: { 'dept!=?', 'finance' }}}

It is impossible to disassociate language from science or science from language, because every natural science always involves three things: the sequence of phenomena on which the science is based, the abstract concepts which call these phenomena to mind, and the words in which the concepts are expressed. To call forth a concept, a word is needed; to portray a phenomenon, a concept is needed. All three mirror one and the same reality.

- Antoine Lavoisier, 1789

Words. Words are magic when they clearly describe a powerful concept. Nationalism. Inertia. Justice. Scientific method.

  • Words as concepts. When the words as concepts can make accurate predictions then we call it science.
  • Takes time for a new word to become powerful - social agreement and applicability. If a new word is disruptive or radical then a word may have to wait a few generations before acceptance. If it's useful enough (the world wide web) then the word might become powerful instantly.
  • Useful new words that are not widely adopted
class CustomerRepairOrder < RepairOrder
end
  • good code
  • steps of the walkthrough
  • javascript concepts
<div class="large-6 columns" ng-controller="metricCtrl">
<select ng-model="selected['metric']" ng-options="m.name for m in metrics"></select>
<table>
<thead>
<tr>
<th>Dealership</th>
<th ng-repeat="metric in metrics" class="{{ activeClass(metric, selected) }}">{{ metric.name }}</th>
</tr>
</thead>
<tbody>

The problem: Active Record objects have built in serialization (to_json), but I want to use vanilla objects wherever possible.

My solution:

class Report
  attr_reader :data, :group_reports
  def initialize(data)
    @data = data
    @group_reports = (data.weekly_group_reports + [data.weekly_used_report]).map { |group_report|
function stripCommas(input) {
return input.replace(/,/, '');
}
function ExpenseForm($el) {
$el.on('submit', clean)
function clean() {
$el.find('input[type=text]').each(function (index, field) {
field.value = stripCommas(field.value);
// RE: https://twitter.com/j3/status/448686275751469056
function DNA(sequence){
"use strict";
var displayedMarkers = ['A', 'T', 'C', 'G'];
var acceptedMarkers = displayedMarkers + ['U'];