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
# Description: | |
# Corgime | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
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
#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 |
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
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/') |
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
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: |
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
// 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 | |
} |
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
/**========================================* | |
* Alchemist.js - Exploring a possible API * | |
*=========================================*/ | |
/**=============* | |
* Conversions * | |
*=============**/ |
NewerOlder