Skip to content

Instantly share code, notes, and snippets.

@rgardner
rgardner / 0_reuse_code.js
Created January 4, 2014 20:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rgardner
rgardner / rails_resources.md
Created January 4, 2014 20:10 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@rgardner
rgardner / bootstrap_template.html
Created January 5, 2014 08:56
HTML Bootstrap Template
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

Political Economy #Refining Classic Liberalism: J.S. Mill and Managing Inequality

  • current events in Ukraine
  • no reading for Tuesday
  • plan for today
    • appearance of double-sided capitalism (+productivity, -inequality)
    • regular, fairly cyclical crises causing concern

##Mill

  • writes about contexts outside of Political Economy too
@rgardner
rgardner / study_guide1.md
Last active August 25, 2024 23:26
Political Economy Study Guide

3/4/14 #Texts & Ideas: Political Economy Midterm 1

##Part I: The Civic and Christian Tradition of Political Economy ###Assumptions of Liberalism

  • humans are rational
  • individual is unit of analysis
  • individuals should have freedom to make own decision
  • commerce seen in positive light
  • the state is separate and distinct from the Market
@rgardner
rgardner / google_interview.txt
Created March 16, 2014 03:56
Google Interview Materials
Books to assist you in preparing for your interview:
"The Algorithm Design Manual"
Author: Steven S. Skiena
"Introduction to Algorithms"
Authors: Cormen, Leiserson, Rivest & Stein
[Also known as the “CLR” textbook]
“Programming Interviews Exposed: Secrets to Landing Your Next Job"
@rgardner
rgardner / index.html
Created April 2, 2014 23:49
HTML Structure
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>

Bob Gardner

Back in Fall 2013, I read The Cathedral & The Bazaar. "The Hacker Attitude" is quoted directly from the Appendix, but I paraphrased "Do you want to become a hacker." I changed (2) to say "Linux" instead of "an open source distribution of Unix" and (3) to say "Internet" instead of "World Wide Web." I don't think (3) needs a clarification, but (2) does. Linux has become very popular among students and researchers. While I have used Solaris at NYU (another Unix variant), Linux has become the standard among many of my peers.

The goal of the following paragraphs is to excite people with esr's words as much as they excited me the first time I read them. People generalize the first three attitudes of a hacker to be "programmers are lazy," but I prefer the

SO: How to get the git commit count?

Update: If all you need is a commit count, and you're running a newer version of git, you can use the following command:

git rev-list HEAD --count

Thanks ctrueden for pointing this out.

Original answer:

@rgardner
rgardner / static-typing.md
Last active August 29, 2015 14:00
Strong vs. Weak; Static vs. Dynamic Typing

The following description is from Bruce Tate's excellent: Seven Languages in Seven Weeks by Bruce A. Tate in his chapter on Scala (p123). The coercion property of strongly typed languages confused me when I first learned about these language designs in my Introduction to Computer Science course. Hope this passage helps someone else too.

My Inner Battle with Static Typing

Strong vs. Weak

Strong Typing

The lanugage detects when two types are compatible, throwing an error or coercing the types if they are not. Examples: Java and Ruby

Weak Typing

the compiler doesn't necessarily care whether the data in a memory location is an integer, a string, or just data.