Skip to content

Instantly share code, notes, and snippets.

View niisar's full-sized avatar
🎯
Focusing

Mohammed Nisar Ansari niisar

🎯
Focusing
View GitHub Profile
@niisar
niisar / shortcut.min.js
Created October 14, 2014 11:31
shortcut.min.js
shortcut={all_shortcuts:{},add:function(e,t,n){var r={type:"keydown",propagate:false,disable_in_input:false,target:document,keycode:false};if(!n)n=r;else{for(var i in r){if(typeof n[i]=="undefined")n[i]=r[i]}}var s=n.target;if(typeof n.target=="string")s=document.getElementById(n.target);var o=this;e=e.toLowerCase();var u=function(r){r=r||window.event;if(n["disable_in_input"]){var i;if(r.target)i=r.target;else if(r.srcElement)i=r.srcElement;if(i.nodeType==3)i=i.parentNode;if(i.tagName=="INPUT"||i.tagName=="TEXTAREA")return}if(r.keyCode)code=r.keyCode;else if(r.which)code=r.which;var s=String.fromCharCode(code).toLowerCase();if(code==188)s=",";if(code==190)s=".";var o=e.split("+");var u=0;var a={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"};var f={esc:27,escape:27,tab:9,space:32,"return":13,enter:13,backspace:8,scrolllock:145,scroll_lock:145,scroll:145,capslock:20,caps_lock:20,caps:20,numlock:144,num_lock:144,num:144,pause:
@niisar
niisar / sollution
Created October 17, 2014 09:18
Why does ASP.Net RadioButton and CheckBox render inside a Span?
► Web controls in the System.Web.UI.WebControls
► you should use the controls in the System.Web.UI.HtmlControls
as
<input type="checkbox" id="CheckBox1" runat="server" class="myClass" />
<input type="radio" name="RadioButton1" runat="server" class="myClass" />
<input type="text" id="TextBox1" runat="server" class="myClass" />
other tecnique
myCheckBoxControl.InputAttributes.Add("class", "myCheckBoxClass");
@niisar
niisar / new 1
Last active August 29, 2015 14:07
google lesssecureapps
https://www.google.com/settings/security/lesssecureapps
@niisar
niisar / template_and_templateURL.html
Created December 11, 2014 01:37
Template and TemplateURL
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="js/angular.js"></script>
<script>
myapp = angular.module("myapp", []);
myapp = angular.module("myapp", []);
myapp.directive('div', function () {
@niisar
niisar / Isolating_Scope.html
Created December 11, 2014 01:45
Isolating Scope in Directive.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="js/angular.js"></script>
<script>
myapp = angular.module("myapp", []);
myapp.directive('userinfo', function () {
var directive = {};
@niisar
niisar / Compile_and_Link_function.html
Created December 11, 2014 01:48
compile() and link() Functions
@niisar
niisar / only_link_function.html
Created December 11, 2014 01:49
Setting Only a link() Function
@niisar
niisar / wrap_element_via_transclude.html
Created December 11, 2014 01:52
Directives Which Wraps Elements Via Transclusion
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="js/angular.js"></script>
<script>
myapp = angular.module("myapp", []);
myapp.directive('mytransclude', function () {
var directive = {};
directive.restrict = 'E'; /* restrict this directive to elements */
@niisar
niisar / query string.js
Created March 18, 2015 11:24
Read query string in js
//read query string in js
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
@niisar
niisar / List.js
Created August 15, 2015 09:48
List Class Implementation
// Defination of construction function
function List(){
this.listSize = 0;
this.pos=0;
this.dataStore = []; //initialize an empty array to store list elements
this.clear =clear;
this.find = find;
this.toString = toString;
this.insert = insert;
this.append = append;