Skip to content

Instantly share code, notes, and snippets.

View mathildathompson's full-sized avatar

mathilda thompson mathildathompson

View GitHub Profile

Crypto Square

One classic method for composing secret messages is called a square code.

The spaces and punctuation are removed from the English text and the characters are written into a square (or rectangle) and the entire message is downcased. For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns.

Difference of Sums of Squares

The sum of the squares of the first ten natural numbers is,

12 + 22 + ... + 10**2 = 385

The square of the sum of the first ten natural numbers is,

(1 + 2 + ... + 10)2 = 552 = 3025

var Post = Backbone.Model.extend({
defaults: {
title: 'New post title',
content: 'New post content', //Remember you cant set an id as a default;
}
});
var Posts = Backbone.Collection.extend({
model: Post
})
//Pages will exist and they will be crawlable and then build backbone on top of it;
//Gradual enhancehement, add JS ontop of it;
//Graceful degredation, build JS and then add rails afterwards;
cp -r zoo zoo-ajax //cp -r means recursive copy;
//Ajax only works if you can talk to a webserver;
python -m SimpleHTTPServer

Extract-Transform-Load

We are going to do the Transform step of an Extract-Transform-Load.

This is a fancy way of saying "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so we're going to migrate this".

Typically, this is followed by "We're only going to need to run this once", which is then typically followed by much forehead slapping and moaning about

Palindrome Product

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99.

Write a program that can detect palindrome products in a given range.

//Backbone (similar ones are ember and angular (ember and anguar are more like rails));
//Problems it solves;
//Its one dependency is underscore;
//SPA use backbone to make single page applications;
//Load everything up front;
//We would just use rails as a JSON API:
//RESOURCES TODOMVC.com
//coldbhead.github.io/converstional-latin/#phrase/330

HTTP/HTTPS UDP - streaming videos, constantly pushing data through rather than sending messages and waiting for responses; TCP/IPV4 = send message and wait for receipt ticket (doesnt do encryption);

HARDWARE

HANDLEBARS -View part of MVC; -Extra features that underscore doesnt support; -Make sure the type is something other than txt/javascript;

cucumber features/calculator.feature #To run the cucumber tests;
group :test do
gem 'cucumber-rails'
gem 'database-cleaner'
end
Feature: User sign up and registration
As a user
I want
##Regular Expressions
#Matches patterns
#RESOURCE
#learning Pearl Regular Exrpressions;
#Regaular expression cheatsheet;
#Rubular.com
#If a match is found, the operator returns index of first match in string, otherwise it returns nil;
/hay/ #quotes are not needed;