This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pizza_crust = "thin" | |
pizza_cheese = "super cheezy" | |
# so on | |
### vs ### | |
pizza = { | |
crust: "thin", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype> | |
<html> | |
<head> | |
<title>hi</title> | |
<style> | |
body, html { | |
background: <%= color %>; | |
font-family: monospace; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// local | |
var separator = "| |"; | |
// global | |
separator = "| |"; | |
// string concat | |
message = "one" + separator + "two"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype> | |
<html> | |
<head> | |
<title>hi</title> | |
<style> | |
body, html { | |
background: #aaa; | |
font-family: monospace; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// now using express to handle routing | |
var express = require('express'); | |
var app = express(); | |
var http = require('http'); | |
var path = require('path'); | |
// attach a middleware | |
var server = http.Server(app); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Intro to Javascript</title> | |
<style> | |
body { background: #358; color: #fff; padding: 50px; font-family: sans-serif; } | |
</style> | |
<script> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
people[0][:emails][2][:a] | |
((5 + 3) * 8 / 9 - 2) | |
subtract(divide(multiply(add(5, 3), 8), 9), 2) | |
people = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>weather</title> | |
<style> | |
body, html { | |
background: #05a; | |
color: #fff; | |
font-family: monospace; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/' do | |
# whatever happens here happens on every request | |
puts "goodbye world" | |
response = "hello #{params[:username]} \n\n \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_most_anagram | |
words = File.open('/usr/share/dict/words').read | |
hash = Hash.new { [] } | |
words.each_line do |word| | |
word = word.strip.downcase | |
signature = word.split('').sort.join('') |