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
<?php | |
if ($_POST['process'] == 1) { | |
$first_name = htmlentities($_POST['first_name']); | |
$last_name = htmlentities($_POST['last_name']); | |
if (empty($last_name)){ | |
echo "<p class=\"error\">Your last name cannot be blank</p>"; | |
} else { | |
echo "<p>Hello there, ".$first_name." ".$last_name."</p>"; | |
} | |
} |
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
.videoWrapper { | |
position: relative; | |
padding-bottom: 55%; /* video dimensions - height/width */ | |
padding-top: 0px; | |
height: 0; | |
z-index: 1000; | |
} | |
video { | |
position: absolute !important; |
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 | |
app = FXApp.new | |
main = FXMainWindow.new(app, "Hello, World!" , :width => 200, :height => 50) | |
app.create | |
main.show(PLACEMENT_SCREEN) | |
app.run |
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 | |
class HelloWorld < FXMainWindow | |
def initialize(app) | |
super(app, "Hello, World!" , :width => 200, :height => 50) | |
end | |
def create | |
super | |
show(PLACEMENT_SCREEN) |
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
if __FILE__ == $0 | |
FXApp.new do |app| | |
HelloWorld.new(app) | |
app.create | |
app.run | |
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
require 'fox16' | |
include Fox | |
class PasswordGenerator < FXMainWindow | |
def initialize(app) | |
super(app, "Password generator", :width => 400, :height => 200) | |
hFrame1 = FXHorizontalFrame.new(self) | |
chrLabel = FXLabel.new(hFrame1, "Number of characters in password:") | |
chrTextField = FXTextField.new(hFrame1, 4) | |
hFrame2 = FXHorizontalFrame.new(self) |
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 generatePassword(pwLength, charArray) | |
len = charArray.length | |
(1..pwLength).map do | |
charArray[rand(len)] | |
end.join | |
end | |
numbers = (1..9).to_a | |
alphabetLowerCase = ("a".."z").to_a | |
alphabetUpperCase = ("A".."Z").to_a |
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) |
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
@includeSpecialCharacters = false | |
specialChrsCheck = FXCheckButton.new(hFrame2, "Include special characters in password") | |
specialChrsCheck.connect(SEL_COMMAND) { @includeSpecialCharacters ^= true } |