##What is JavaScript? Created by Brendan Eich in 1995 for the Netscape browser
###Features
- functional
- object oriented
- asyncronous
- event-based
| // NOTE: I previously suggested doing this through Grunt, but had plenty of problems with | |
| // my set up. Grunt did some weird things with scope, and I ended up using nodemon. This | |
| // setup is now using Gulp. It works exactly how I expect it to and is WAY more concise. | |
| var gulp = require('gulp'), | |
| spawn = require('child_process').spawn, | |
| node; | |
| /** | |
| * $ gulp server | |
| * description: launch the server. If there's a server already running, kill it. |
| var stream = require("stream"), | |
| util = require("util"); | |
| var LineSplitter = function LineSplitter(options) { | |
| options = options || {}; | |
| options.objectMode = true; | |
| stream.Transform.call(this, options); | |
| this.buffer = ""; | |
| }; | |
| util.inherits(LineSplitter, stream.Transform); |
| # Description: | |
| # Corgime | |
| # | |
| # Dependencies: | |
| # None | |
| # | |
| # Configuration: | |
| # None | |
| # | |
| # Commands: |
| #The Ruby code your mom should have handed you: | |
| # products = { milk => [], eggs => [] } | |
| # cart = [] | |
| cart << products[:milk].pop | |
| if !products[:eggs].empty? | |
| 6.times do | |
| cart << products[:eggs].pop |
| uri = URI('https://www.your-site.com/home/') | |
| https = Net::HTTP.new(uri.host, uri.port) | |
| https.use_ssl = true | |
| https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
| # use OpenSSL::SSL::VERIFY_PEER instead and https.ca_file for a verified cert | |
| https.start do |http| | |
| request = Net::HTTP::Get.new uri.request_uri | |
| request.basic_auth 'username','password' | |
| response = https.head('/home/') |
| var array = [] | |
| array[1] = "a value" | |
| array[2] = "a new value" | |
| console.log(array) // returns ["a value","a new value"] | |
| // p.s. console.log() and alert() are interchangeable. If you use console.log the | |
| // message appears in your browser's console rather than in a popup. | |
| // That's kinda obvious but here's something your probably haven't used yet: |