Skip to content

Instantly share code, notes, and snippets.

View jesse1981's full-sized avatar
💭
Nerding

Jesse Bryant jesse1981

💭
Nerding
View GitHub Profile
@jesse1981
jesse1981 / XmlLoader.vbs
Created May 7, 2013 23:44 — forked from YujiSoftware/Module1.bas
XML Fetch/Parse example
Option Explicit
Public Function GetXmlData(url As String) As Object
'http://msdn.microsoft.com/ja-jp/library/aa468547.aspx
Dim dom As Object
Set dom = CreateObject("MSXML2.DOMDocument")
dom.async = False
'http://support.microsoft.com/kb/281142/ja
@jesse1981
jesse1981 / closest_descendent.js
Created May 7, 2013 23:44 — forked from lokimeyburg/closest_descendent.js
Find closest child element which matches given filter.
$.fn.closest_descendent = function(filter) {
var $found = $(),
$currentSet = this; // Current place
while ($currentSet.length) {
$found = $currentSet.filter(filter);
if ($found.length) break; // At least one match: break loop
// Get all children of the current set
$currentSet = $currentSet.children();
}
return $found.first(); // Return first match of the collection
@jesse1981
jesse1981 / scroll_infinite.js
Created May 7, 2013 23:44
A method to invoke increasing pagination when window scroll gets to the bottom.
$(window).scroll(function(){
var $window = $(this);
if($window.scrollTop() == $(document).height() - $window.height()) $('#more').click()
});
@jesse1981
jesse1981 / getFileData.vbs
Created May 8, 2013 00:07
Get file contents to variable.
function includeFile (fSpec)
On Error Resume Next
dim fileSys, file, fileData
set fileSys = createObject ("Scripting.FileSystemObject")
set file = fileSys.openTextFile (fSpec,ForReading)
fileData = file.readAll ()
file.close
set file = nothing
@jesse1981
jesse1981 / fileExists.vbs
Created May 8, 2013 00:14
Check to see if a file exists
function checkExists (filepath)
dim fs, result
set fs = createObject("Scripting.FileSystemObject")
result = fs.fileExists(filepath)
set fs=nothing
checkExists = result
end function
@jesse1981
jesse1981 / flip.js
Last active June 20, 2021 23:33
Two sided DIV example with flip over animation. See Also: http://stackoverflow.com/questions/10035643/jquery-how-to-do-a-flip-effect
document.getElementById( 'signup' ).addEventListener( 'click', function( event ) {
event.preventDefault();
document.getElementById( 'side-2' ).className = 'flip flip-side-1';
document.getElementById( 'side-1' ).className = 'flip flip-side-2';
}, false );
document.getElementById( 'create' ).addEventListener( 'click', function( event ) {
@jesse1981
jesse1981 / getPageURL.vbs
Created May 8, 2013 06:36
Method to get the current page URL.
function curPageURL()
dim s, protocol, port
if Request.ServerVariables("HTTPS") = "on" then
s = "s"
else
s = ""
end if
protocol = strleft(LCase(Request.ServerVariables("SERVER_PROTOCOL")), "/") & s
@jesse1981
jesse1981 / xmlUpdate.vbs
Created May 8, 2013 06:42
ASP XML search, update, delete example
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = false
xmlDoc.load("filename.xml")
' See if given id exists
Dim idExists, currParentNode
idExists = false
Set objNodeList = xmlDoc.selectNodes("/events/event/id")
For each x in objNodeList
@jesse1981
jesse1981 / inverse.php
Created June 10, 2013 05:10
Number inverse
<?php
function inverse($num,$max) {
for ($i=0;$i<=$max;$i++) {
if ($num == ($max-$i)) return $i;
}
}
?>
window.fbAsyncInit = function() {
FB.init({
appId: 'Your_APP_ID',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
showLoader(true);