Skip to content

Instantly share code, notes, and snippets.

KC KazChe

Block or report user

Report or block KazChe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KazChe
KazChe / padolsys.js
Created May 25, 2012 — forked from padolsey/gist:527683
detects ie
View padolsys.js
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@KazChe
KazChe / LabesFromID.js
Created Aug 8, 2012
get label's value from id - error message issue
View LabesFromID.js
labels = document.getElementsByTagName('label');
len = labels.length;
for(var i = 0; i < len; i++) {
if(labels[i].htmlFor == elementId) {
errLabel= labels[i].innerHTML;
}
}
@KazChe
KazChe / Tabs_Modifications_POC.html
Created Aug 9, 2012
poc for modifying other pages to use Tabs
View Tabs_Modifications_POC.html
<li><a href="/campaignManagerWeb/mb/createsmspushoffer">Create .....</a></li>
<!-- add the above to the ul and no div container for it -->
<!-- issues: 1.cmsleftmenu.jsp taken out 2.pagination calls must be turned to ajax calls in order to keep content within tab otherwise goes to page -->
@KazChe
KazChe / gist:6905107
Created Oct 9, 2013
nodejs - easy way to upgrade an existing install
View gist:6905107
> sudo npm cache clean -f
> sudo npm install -g n
> sudo n stable <or specific version>
@KazChe
KazChe / gist:6930300
Created Oct 11, 2013
Checking in existing local code into a repository already created via web console.
View gist:6930300
git init
git add .
git status
git commit -m"inital checkin"
git remote add origin https://github.com/<UID>/<REPO_NAME>
git pull origin master
View gist:6930781
git add .
git status
commit -m"blah blurb boop"
git push origin master
@KazChe
KazChe / gist:6954708
Last active Dec 25, 2015
simple Object.observe() - run in Chrome Canary with experimental javascript flag enabled.
View gist:6954708
function ObserveMe() {
var x =
{
"thing":
{ "label": "party",
"value": "republican"
}
}
return x;
}
View gist:9110375
<html ng-app='q.apApp'>
View blog1_second_gist.html
<form name="gonebatty" ng-app="q.apApp" ng-controller='AppController' method="post" novalidate>
<label>Header Font Color:</label>
<input type="text" id="font-color" ng-model="homePageHeaderFontColor"
hexadecimal-color-validation={{homePageHeaderFontColor}}>
<span ng-show="gonebatty.homePageHeaderFontColor.$error.validHexColor" class="errorMessage" ng-cloak>
Invalid color code
</span>
View blog_gist_3.js
angular.module('angularstruts').directive('hexadecimalColorValidation', [function(){
return {
restrict: 'A',
require: 'ngModel',
scope: {
},
link: function(scope, elem, attrs, ctrl) {
elem.on('blur', function(event) {
scope.$apply(function() {
var val, hexCodeRegex, validationResult=true;
You can’t perform that action at this time.