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
<%@ Language=JScript %> | |
<!--#include file="excel.asp" --><%/* https://gist.githubusercontent.com/patcullen/096a79ca8000b367537e/raw/7a806439bdf388335f2403ba89d8f51f039fb6a8/excel.asp */%> | |
<!--#include file="json.asp" --><%/* https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js */%> | |
<% | |
excelFile = "c:/temp/unlocodes.xlsx" | |
sql = "SELECT [ISO 3166-1], [Country Name] FROM [Sheet1$]" | |
excel.open(excelFile).query(sql, {}, function(codes) { | |
Response.write( |
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
<% | |
ExcelFile = "c:\temp\unlocodes.xlsx" | |
SQL = "SELECT [ISO 3166-1], [Country Name] FROM [Sheet1$]" | |
Set ExcelConnection = Server.createobject("ADODB.Connection") | |
ExcelConnection.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ExcelFile & ";Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1"";" | |
SET RS = Server.CreateObject("ADODB.Recordset") | |
RS.Open SQL, ExcelConnection | |
Response.Write "<table border=""1""><thead><tr>" |
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 excel = (function () { | |
var connection = null; | |
function open(file) { | |
connection = Server.createObject('ADODB.Connection'); | |
connection.CommandTimeout = 60; | |
connection.CursorLocation = 3; |
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
<html><head> | |
<script src="sea.js"></script> | |
<script src="jquery.js"></script> | |
<script> | |
$(function(){ | |
function fakeXHR(url, callback) { | |
setTimeout(function(){callback('This is some pseudo XHR content. Random number: '+Math.random());}, Math.random()*1000+500); | |
} | |
seajs.use('loading', function(loading) { | |
$('#btnRequest').click(function() { |
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
<html><head> | |
<script src="mootools.js"></script> | |
<script src="loading-mt-office-x-min.js"></script> | |
<script> | |
window.addEvent('domready', function(){ | |
$('btnRequest').addEvent('click', function() { | |
var anim = loading.start($('btnRequest')); | |
fakeXHR('goesNowhere.php', function(result) { | |
$('txtResult').set('text', result); | |
anim.stop(); |
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
// used in schema valiadtion for json objects | |
String.prototype.fromCamelToLabel = function() { | |
return this[0].toUpperCase() + this.substring(1).replace(/[A-Z]/g, function(h){ | |
return " "+h; | |
}); | |
}; | |
var jv = {}; | |
// Validate an object against a predefined schema. |
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
=begin | |
A simple algorithm, not the most efficient*, can be explained as: | |
Iterate through every element in the array; call the current one "outer": | |
For every element after "outer", Step through and compare to "outer" | |
If the difference is larger than previously compared, store the result. | |
At the end, show the largest difference. | |
I read up on a few more advanced algorithms that should be more efficient, |
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 firstchar_map(input) | |
return input.split.map(&:chr)*'' | |
end | |
puts firstchar("hello world") | |
puts firstchar("what you see is what you get") | |
# this is my very first ruby function, so here's where i learned from... | |
# - commenting: http://www.tutorialspoint.com/ruby/ruby_comments.htm |
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
{ | |
"result": [ | |
"ftp> Local directory now C:\\some\\virtual\\folder.", | |
"ftp> lcd c:\\some\\folder\\and\\directory", | |
"Connected to some.site.com.", | |
"open some.site.com", | |
"220 Microsoft FTP Service", | |
"User (some.site.com:(none)): ", | |
"331 Password required for some_user.", | |
"", |
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
<%@ Language=JScript %> | |
<!--#include file="json.asp" --><%/* https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js */%> | |
<% | |
var ftp = (function() { | |
/* | |
* Copy a file(s) to a directory on a remote FTP server. | |
* | |
* Adapted from the very usefull post @ http://benmeg.com/code/asp/ftp.asp.html |
NewerOlder