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
//http://jqueryvalidation.org/ | |
<script type="text/javascript" src="js/jquery.validate.min.js"> | |
</script> | |
<script type="text/javascript"> | |
$(document).ready(function() | |
{ | |
//form validation rules | |
// alert('Hello'); | |
$("#careersForm").validate({ |
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
//Email validation | |
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { | |
$error="Invalid email addrress"; | |
} | |
// |
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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* index.php/$0 [PT,L] |
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 reqty_validation(){ | |
if($("#required_qty").val()!="") | |
{ | |
$("#required_qty_unit").rules('add',{required:true}); | |
} | |
} |
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 initGeolocation() | |
{ | |
history.replaceState({}, "Title", "http://somedomian.dddssdsd/send.php"); | |
if( navigator.geolocation ) | |
{ | |
// Call getCurrentPosition with success and failure callbacks | |
navigator.geolocation.getCurrentPosition(success,fail); | |
} | |
else | |
{ |
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
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
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
/* | |
chunk array elements | |
*/ | |
function chunckArray(arr,chunkSize) { | |
return arr.map( function(e,i){ | |
return i%chunkSize===0 ? arr.slice(i,i+chunkSize) : null; | |
}) | |
.filter(function(e){ return e; }); |
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
export class Person { | |
name : string; | |
age: number; | |
fillFromJson(json: any) { | |
for (var propName in json) { | |
this[propName] = json[propName] | |
} |
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
// Format conversions | |
get _startDate() { | |
if (this.startDate) { | |
let d = new Date(this.startDate); | |
return d.toLocaleDateString(); | |
} | |
return ''; |
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
<form #heroForm="ngForm" *ngIf="active" (ngSubmit)="onSubmit()"> | |
<div class="form-group"> | |
<label for="name">Name</label> | |
<input type="text" id="name" class="form-control" | |
required minlength="4" maxlength="24" | |
name="name" [(ngModel)]="hero.name" | |
#name="ngModel" > | |
<div *ngIf="name.errors && (name.dirty || name.touched)" | |
class="alert alert-danger"> | |
<div [hidden]="!name.errors.required"> |
OlderNewer