JavaChip my attempt to make JavaScript simpler, more predictable, and provide control-flow tools to make development in an asyncronous environment more comfortable.
[]
– a collection of data (arrays, lists, dicts, hashes)
/**========================================* | |
* Alchemist.js - Exploring a possible API * | |
*=========================================*/ | |
/**=============* | |
* Conversions * | |
*=============**/ |
// create a "Class-like" object | |
var Point = {} | |
// create an object like this one, but with a clean state | |
Point.create = function create () { | |
var new_shape = Object.create(this) | |
new_shape.init.apply(new_shape, arguments) | |
return new_shape | |
} |
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: |
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/') |
#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 |
# Description: | |
# Corgime | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
{ | |
"name": "web-app", | |
"scripts": { | |
"build": "gulp build", | |
"start": "gulp serve", | |
"test": "gulp test" | |
}, | |
"devDependencies": { | |
"gulp": "~3" | |
} |