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 'net/ftp' | |
CONTENT_SERVER_DOMAIN_NAME = "one-of-the-ftp-server.thought-sauce.com.hk" | |
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login" | |
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password" | |
# LOGIN and LIST available files at default home directory | |
Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp| | |
files = ftp.list |
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
# this was surprisingly difficult to find, the documentation and API is poor | |
require "net/http" | |
require "uri" | |
url = URI.parse("http://www.whatismyip.com/automation/n09230945.asp") | |
req = Net::HTTP::Get.new(url.path) | |
req.add_field("X-Forwarded-For", "0.0.0.0") | |
# For content type, you could also use content_type=(type, params={}) |
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
def transform_hash(original, options={}, &block) | |
original.inject({}){|result, (key,value)| | |
value = if (options[:deep] && Hash === value) | |
transform_hash(value, options, &block) | |
else | |
value | |
end | |
block.call(result,key,value) | |
result | |
} |
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 'rubygems' | |
require 'faker' | |
# puts "Please Enter your name: " | |
# person_name = gets.chomp | |
# puts "Please Enter your email address: " | |
# person_email = gets.chomp | |
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
function StaffMember(name,discountPercent){ | |
this.name = name; | |
this.discountPercent = discountPercent; | |
} | |
var sally = new StaffMember("Sally",5); | |
var bob = new StaffMember("Bob",10); | |
// Create yourself again as 'me' with a staff discount of 20% | |
var me = new StaffMember("Angel", 20); |
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 totalGen = 19; | |
var totalMW = 0; | |
var smallMW = 62; | |
var largeMW = 124; | |
var capacity = 0; | |
for (var genNum = 1; genNum <= totalGen; genNum++){ | |
if (genNum <= 4){ | |
capacity = smallMW; | |
}else{ |
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
$(function(){ | |
$('input').change(function(x){ | |
if (x.target.value !== "Wyncode"){ | |
$(x.target).addClass('red'); | |
}; | |
}); | |
}) | |
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
.red { | |
color: red; | |
border-color: red; | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF8"></meta> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="Input_Validation.js"></script> | |
<link rel="stylesheet" type="text/css" href="Input_Validation.css" /> | |
<title>InputValidation</title> |
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
<!DOCTYPE html> | |
<html> | |
<header> | |
<meta charset="UTF-8"> | |
<title>Title goes here</title> | |
</header> | |
<body> | |
<h1>¡Hola Miami!</h1> | |
<h2>Ça va?</h2> |
NewerOlder