Skip to content

Instantly share code, notes, and snippets.

// TicTacToe.cpp
// for CS 141 lab 4
// Password: Brown
//
#include <iostream>
using namespace std;
//----------------------------------------------------------------------------------
// Display the board.

Managing Secret Data in Open source Applications

If you're working on an open source project, committing API keys or secrets to your repo is a big no-no. You wouldn't want anyone else making request with your keys, right?

So instead of putting those keys in app/config/initializers set then as environment variables in your shell. Here's an example for a Facebook API key:

export FB_API_KEY=3629346238763284623874623

Design Process

  1. Define the problem.
  2. Wireframe.
  3. Prototype.
  4. Test, gather feedback, refine.

Define the problem

  • Talk to people (users, clients, customers, businesspeople).
@Carpk
Carpk / sudoku.rb
Last active August 29, 2015 13:57
Sudoku solver
require 'benchmark'
class Sudoku
def initialize(board_string)
@board = create_board(board_string.split(//).map {|str| str.to_i})
@potentials = (0..9).to_a
end
def create_board(num_array)

Web App Performance

Back End

N+1

  @users = User.all.includes(:profile) # SELECT * from users

Excessive joins/subselects or exta queries

@Carpk
Carpk / RSpec.md
Last active February 21, 2016 06:21
rspec cheatsheet

CHEAT SHEETS

$ command line ruby cheat sheets

INSTALL

$ gem install rspec

Definitions

General Testing

  • TDD Test Driven Development. Write examples before implementation.
  • BDD Behaviour-Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders. (The Rspec Book)
  • RSpec (mention alternatives, write a simple hand sewn test)

Testing Terms

Tips for a #WINNING Github Profile

The basics

As a new developer some potential employers are going to review your Github profile as part of the interview process. This doc covers some tips that should help you make a good impression. What this doc won't do is polish a turd.

README

Think of your experiences reviewing a Gem or other JS library on Github. Where do you look first? The README of course. What makes for a frustrating repo? One that doesn't:

  • include a README.
  • include install instructions (if applicable)
@Carpk
Carpk / Git workflow.md
Created February 15, 2014 18:24
Tara's github workflow

#Git workflow

To understand git on a conceptual level, visit this git visual demo, the most epic git tutorial on the web.

We are chosing to work with a branching workflow. Every pair works in their own branch, and when we have our branch working to our satisfaction, we merge it into the master branch.

###Set up github repository

Set up git repository and add everyone as collaborators.

@Carpk
Carpk / index.html
Last active August 29, 2015 13:56 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>