Skip to content

Instantly share code, notes, and snippets.

View mathildathompson's full-sized avatar

mathilda thompson mathildathompson

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Bucketlist</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<div class="googlemaps">
var map;
function initMap() {
var mapOptions = {
center: new google.maps.LatLng(48.8530, 2.3498),
zoom:12,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
#nokogiri callbacks
require_relative 'wiki_handler'
class WikiImport < Nokogiri::XML::SAX::Document
include WikiHandler
# A stack (Array) of attributes as we find them
attr_accessor :attribute_stack
<!DOCTYPE html>
<html>
<head>
<title>Wikisearch</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
app.views.ProjectView = Backbone.View.extend({
tagName: 'div',
className: 'project',
template: _.template($('#project-template').html()),
events: {
'dblclick .project-name': 'editProjectName',
'keypress .edit-title': 'updateTitle',
'dblclick .body': 'editBody',
'keypress .edit-body': 'updateBody',

Github, Git, Command Line, Markdown

COMMAND LINE

  • whoami - tells you the name of the current user;
  • cd - - takes you back to where you just were;
  • pwd - tells you where you are;
  • clear or ctrll- clears the screen;
  • open . - this will open the file in Finder;
  • ls - lists all of the folders;
  • mkdir - makes a folder;

##RUBY

-Type irb into the command line to get into irb;

  • 5 - this is an integer;
  • 5.0 - this is a floating point number;
  • "This is a string"
  • 'I am also a string'
  • "holly's" (this is why we need both single and double quotes)
  • ctrld (takes out out if you make a mistake)
  • 'that is so "ironic"'
@mathildathompson
mathildathompson / day_2_morning.rb
Last active August 29, 2015 13:56
Conditionals & Loops
#FLOW CONTROL
- Conditionals;
- Loops;
#PATH
- echo $PATH - shows all the paths the computer searches through (the paths are separated by a colon);
- which - will tell you which programme was run (if two files have the same name, it will run the first one found in the path);
- The ruby language will allow you to get hold of the process.id
- If you type irb into terminal, you can then type Process.pid to get the process id;
##RECAP
#Arrays ['literal', 'notation', 555]
#While loops
#If statements
#Functions
#The interpreter reads from top down;
#Compare a sequence of values put them into an array and then can check if it is included in an array;
##HOMEWORK SUBMISSION
99 Bottles of Beer
Write a program which prints out the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
Requirements
Your file should be called beer.rb
The program should output to STDOUT using puts
To run the file:
ruby beer.rb