This file contains hidden or 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> | |
<title>Test Suite</title> | |
<meta charset="utf-8" /> | |
<script> | |
function assert(value, desc) { | |
var li = document.createElement('li'); | |
li.className = value ? 'pass' : 'fail'; | |
li.appendChild(document.createTextNode(desc)); |
This file contains hidden or 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
// Asserts expression | |
function assert(value, desc) { | |
var li = document.createElement('li'); | |
li.className = value ? 'pass' : 'fail'; // li css class must be created | |
li.appendChild(document.createTextNode(desc)); | |
document.getElementById('results').appendChild(li); // Assumes ul id is 'results' | |
} |
This file contains hidden or 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
SSL on Ubuntu | |
Install ss-cert package: | |
apt-get install ssl-cert | |
Activate ssl module on Apache2: | |
a2enmod ssl | |
Configure Apache2 for https: | |
a2ensite default-ssl |
This file contains hidden or 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
// Disables enter key on all input fields on #Form. Can also shift focus to next input field | |
$('#Form').on('keypress', 'input', function(event) { | |
if (event.keyCode == 13) { | |
event.preventDefault(); | |
if ('You want enter2tab') { | |
$(this).next('input').focus(); | |
} else { // Just disable enter key | |
return false; | |
} |
This file contains hidden or 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
// Add colorclass 'yellow' (background-color: #FFFF66) on focus to elements with class 'text' | |
$('.text').on('focus', function(event) { | |
$(this).addClass('yellow'); | |
}); | |
// Remove added colorclass 'yellow' on blur from elements with class 'text' | |
$('.text').on('blur', function(event) { | |
$(this).removeClass('yellow'); | |
}); |
This file contains hidden or 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 delpart(id) { | |
$(id).closest('tr').remove(); | |
} | |
$("#AddPart").click(function() { | |
'use strict'; | |
var userID = $('#sel_Participants').val(); // Get value from select | |
var userName = $('#sel_Participants option:selected').text(); // Get text from select | |
This file contains hidden or 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
$('#ParentID').change(function() { // Populate selectbox #ChildID based on selected option in #ParentID | |
// alert( "Handler for .change() called." ); | |
// Ajax data | |
var data = new Object(); | |
data.parentID = $('#ParentID').val(); // Get value from select | |
// Ajax options | |
var options = new Object(); | |
options.data = data; |
This file contains hidden or 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
// Ajax data | |
var data = new Object(); | |
data.property1 = 'Prop1'; | |
data.property2 = 'Prop2'; | |
// Ajax options | |
var options = new Object(); | |
options.data = data; | |
options.dataType = 'text'; | |
options.type = 'post'; |
This file contains hidden or 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
$(document).ready(function() { | |
}); |
This file contains hidden or 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
MySQL Cheat Sheet | |
Indexes: | |
- UNIQUE | |
- INDEX | |
- PRIMARY KEY | |
- FULLTEXT (MyISAM engine only) | |
SHOW ENGINES -> shows available storage engines and default storage engine |
NewerOlder