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
<h1><%= @path %></h1> | |
<ul> | |
<% if archives.length > 0 %> | |
<% archives.sort! {|x,y| y[:date] <=> x[:date] } %> | |
<% archives.collect {|a| a[:date].year }.uniq.each do |year| %> | |
<h3><%= year %></h3> | |
<% archives.select {|e| e[:date].year == year }.each do |entry| %> | |
<li> |
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
component output="no" { | |
public function fileAnchorTag( | |
required relativePath, | |
displayName, | |
fileType) { | |
// determine file details | |
var fileInfo = GetFileInfo(ExpandPath(relativePath)); | |
// set default 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
var Mammal = function (name) { | |
this.name = name; | |
}; | |
Mammal.prototype.sayHello = function () { | |
return "Hello, I'm a " + this.name; | |
} | |
var Cow = function (name) { | |
Mammal.apply(this, arguments); |
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
component output="no" { | |
function init() { | |
variables.itemArray = []; | |
} | |
function append(item) { | |
ArrayAppend(variables.itemArray, arguments.item); | |
} | |
function sortBy(key){ |
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
component { | |
function init(required string configFile) { | |
variables.configFile = arguments.configFile; | |
variables.loadSections = ["common", CGI.SERVER_NAME]; | |
return getConfig(); | |
} | |
private function getConfig() { | |
var config = StructNew(); |
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/http' | |
require 'uri' | |
print <<INFO | |
QR Code Generator | |
Generated codes will be saved to "label.png" in the current directory | |
INFO | |
print "Text to encode: " | |
label_contents = gets.strip |
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(){ | |
var geocoder = new google.maps.Geocoder(); | |
/* use Google Geocoder in jQueryUI autocomplete widget */ | |
$("#search").autocomplete({ | |
minLength:8, | |
source:function(request,response) { | |
geocoder.geocode({address:request.term}, function(result,status){ | |
var addresses = jQuery.map(result, function(address){ return address.formatted_address; }); | |
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
component output="no" name="qr" { | |
function encode(required string message) { | |
var url = "http://chart.apis.google.com/chart"; | |
url &= "?cht=qr&chs=200x200"; | |
url &= "&chl=#message#"; | |
return image_tag(url,200,200,message); | |
} | |
function image_tag(url,w,h,alt) { |
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
USE AdventureWorks2008; | |
WITH ShippingTime(OrderDate,ShipDate,DaysToShip) AS | |
( | |
SELECT OrderDate, ShipDate,DATEDIFF(day,OrderDate,ShipDate) | |
FROM Sales.SalesOrderHeader | |
) | |
SELECT * | |
FROM ShippingTime; |
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> | |
<link href="grid.css" type="text/css" rel="stylesheet" /> | |
<style type="text/css"> | |
p {border:1px solid black;} | |
.container_12 {background:#ddd; } | |
body{background:#ccc; } | |
</style> | |
</head> |