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 chooseCharset(includeSpecialCharacters) | |
if includeSpecialCharacters | |
@charSets.first | |
else | |
@charSets.last | |
end | |
end |
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
charSets = [ALL_POSSIBLE_CHARS, NUMBERS + ALPHABET_LOWER + ALPHABET_UPPER] | |
PasswordGenerator.new(app, charSets) |
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
packer = FXPacker.new(self, :opts => LAYOUT_FILL) | |
groupBox = FXGroupBox.new(packer, nil, :opts => FRAME_RIDGE | LAYOUT_FILL_X) |
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
hFrame3 = FXHorizontalFrame.new(vFrame1, :opts => PACK_UNIFORM_WIDTH) |
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 'fox16' | |
include Fox | |
NUMBERS = (1..9).to_a | |
ALPHABET_LOWER = ("a".."z").to_a | |
ALPHABET_UPPER = ("A".."Z").to_a | |
ALL_POSSIBLE_CHARS = (33..126).map{|a| a.chr} | |
class PasswordGenerator < FXMainWindow | |
def initialize(app, charSets) |
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 isCanvasSupported(){ | |
var elem = document.createElement('canvas'); | |
return !!(elem.getContext && elem.getContext('2d')); | |
} | |
$(document).ready(function() { | |
if(isCanvasSupported()){ | |
alert("Yay!"); | |
} | |
}); |
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 clearCanvas(context, canvas) { | |
context.clearRect(0, 0, canvas.width, canvas.height); | |
var w = canvas.width; | |
canvas.width = 1; | |
canvas.width = w; | |
} | |
function highlightRoom(x, y, h, w){ | |
var can = document.getElementsByTagName('canvas')[0]; | |
var ctx = can.getContext('2d'); |
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 lang="en-us"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Lightbox 2 with <canvas> overlay - Example 1</title> | |
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> | |
<style> | |
.plan{ | |
display:none; | |
background-image: url(images/plan.jpg); |