Skip to content

Instantly share code, notes, and snippets.

View martinlaws's full-sized avatar

Martin Laws martinlaws

  • Toronto, ON
  • 03:16 (UTC -04:00)
View GitHub Profile
@martinlaws
martinlaws / .hyper-sync-settings.js
Last active March 29, 2019 23:40
Hyper terminal settings
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: "canary",
@martinlaws
martinlaws / 0_lecture_notes.md
Created August 22, 2016 20:53 — forked from fzero/0_lecture_notes.md
LighthouseLabs - W6D1 Breakout - JS + DOM intro

Javascript in the browser!

  • window, navigator
    • BOM - Browser Object Model
      • navigator represents the the browser basic code (or kernel) and properties, like version, user agent string, language, geolocation options and so on.
      • window is a "god object" containing all browser components, such as the address bar (window.location), modal dialogues (alert(), prompt()) and the window being displayed on screen itself. It's also the top object where all global variables are assigned to.
  • document
    • DOM - Document Object Model
    • Contains all of the content being displayed - in other words, whatever is inside the window.
  • The document represents all content as nodes - tags, text, images, and so on.
@martinlaws
martinlaws / README.md
Created August 3, 2016 22:20 — forked from hofmannsven/README.md
My simply Git Cheatsheet
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<h1>Welcome to the <em>Fancy Betting Game</em>!</h1>
<p id='wallet'></p>
var myArray = []
var i = 0
var arrayOfLight = function(x) {
while(i < x + 1) {
myArray.push(i)
i++;
}
}
-- Exercise 1
SELECT book_id
FROM editions
WHERE publisher_id = 59;
-- Excercise 2
SELECT b.id, b.title, e.book_id
FROM books AS b, editions AS e
-- Exercise 1
SELECT book_id
FROM editions
WHERE publisher_id = 59;
-- Excercise 2
SELECT b.id, b.title, e.book_id
FROM books AS b, editions AS e
# Define 8 empty classes: Animal, Mammal, Amphibian, Primate, Frog, Bat, Parrot, and Chimpanzee.
class Animal
attr_reader :num_legs
def warm_blooded?
@warm_blooded
end
end
module Flight
attr_reader :speed
def letter_count(string)
counting = Hash.new(0)
indexing = Hash.new { |hash, key| hash[key] = [] }
string.split('').each_with_index do |letter, index|
next if letter == ' '
counting[letter] += 1
indexing[letter] << index
end
puts counting
puts indexing
@martinlaws
martinlaws / 1_hello_world.rb
Created October 25, 2015 01:30
rspec exercises - lhl wk1e
### SETUP
require 'rspec'
### LOGIC (fix me)
def hello(who)
"hello #{who}!"
end
### TEST CODE (don't touch me)