At Wyncode we turn people into full-stack web developers in 10 weeks. So we've learned a few tricks to get from 0 to webapp quickly.
This file contains 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
// because of hoisting, variables are typically declared at the top of the "scope" | |
// var a = 1; | |
// var b; | |
// var h = "hello"; | |
// you can declare multiple variables at once | |
// var a = 1, b, h = "hello"; | |
// make sure the file is working | |
// console.log('hello'); |
This file contains 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
# title | |
puts "Chapter 1" | |
# line 1 | |
puts "It was the best of times" | |
# rest of the text | |
puts "It was the wrost of times" |
This file contains 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
// Paste into the JavaScript console. | |
// | |
// Add "javascript:" to the front if you want to bookmark it | |
// South Florida Business Journal | |
$('.content--embargoed').attr('style', 'display: block !important; opacity: 1');$('.paywall--premium').remove();$('.paywall--free').remove();$('.paywall--free').hide();$('.content__segment').show(); | |
// Miami Herald | |
$("#ppUI").hide() && $("#pressplusOverlay").hide() |
This file contains 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
class Node | |
def initialize(xml_str) | |
@name = @attributes = @content = '' | |
parse(xml_str) | |
p @name, @attributes, @content | |
end | |
def parse(xml_str) | |
# state indicators | |
inside_tag = inside_tag_name = inside_tag_attributes = false |
This file contains 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 'rspec/autorun' | |
# A Set is an Array that is automatically de-duplicated (uniq'd) | |
require 'set' | |
#### | |
## Coordinate | |
## | |
## an x,y coordinate pair |
This file contains 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
module AlphabetTesters | |
# self methods | |
# activated on require | |
# must be called with namespace | |
# e.g. AlphabetTesters.a? | |
def self.a?(letter) | |
letter.downcase == "a" | |
end | |
def self.b?(letter) |
This file contains 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
# display a line on the screen | |
# | |
# refactoring to | |
# - remove some Ruby jargon by defining a | |
# domain-specific-language (DSL) | |
# - remove some repetitive (copy-pasted) code | |
# - have a single place to change the line width | |
def put_a_line | |
puts "*" * 50 | |
end |
NewerOlder