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
| var | |
| k1='key1', | |
| k2='key2', | |
| obj={}; | |
| obj[k1]='dynamic key val 1'; | |
| obj[k2]='dynamic key val 2'; | |
| // writes "dynamic key val 1" | |
| write(obj.key1); |
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
| $ vim /etc/sysconfig/network | |
| HOSTNAME={NEW_HOSTNAME} | |
| $ vim /etc/hosts | |
| 127.0.0.1 {NEW_HOSTNAME} | |
| $ hostname {NEW_HOSTNAME} | |
| $ /etc/init.d/network restart |
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
| // Remove Item from Array | |
| $(document).ready(function(){ | |
| var arr = ["jQuery","JavaScript","HTML","Ajax","Css"]; | |
| var itemtoRemove = "HTML"; | |
| arr.splice($.inArray(itemtoRemove, arr),1); | |
| }); |
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
| // example url='ex.com/index.php?name=heyhey' | |
| // get name param. from query string | |
| var name=getQueryVariable('name'); | |
| function getQueryVariable(variable) | |
| { | |
| var query = window.location.search.substring(1); | |
| var vars = query.split("&"); | |
| for (var i=0;i<vars.length;i++) { |
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
| $controllerId=Yii::app()->controller->id; | |
| $actionId=Yii::app()->controller->action->id; |
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
| <script type="text/javascript"> | |
| var cssFiles=['css/custom/modal.css','css/custom/modal2.css']; | |
| getCss(cssFiles,baseUrl); | |
| </script> |
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
| <link rel="import" href="../topeka-elements/category-images.html"> | |
| <link rel="import" href="../core-icon/core-icon.html"> | |
| <link rel="import" href="../core-icons/core-icons.html"> | |
| <link rel="import" href="../core-icons/av-icons.html"> | |
| <link rel="import" href="../paper-fab/paper-fab.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> |
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
| <?php | |
| //... | |
| public function actionGetRouteStopsByRouteId() | |
| { | |
| $p=$_POST; | |
| $routeId=null; | |
| foreach ($p as $param) { | |
| if(!empty($param['routeId'])) |
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
| <?php | |
| /* | |
| QUESTION | |
| -------- | |
| Verify if the given password is valid/invalid; | |
| 1. must be 5-12 characters long | |
| 2. must contain atleast one number and one lowercase character | |
| 3. a sequence must not be followed by the same sequence (like 123123qs is invalid, 123qs123 is valid) | |
| */ |
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
| <?php $form=$this->beginWidget('CActiveForm', array( | |
| 'id'=>'login-form', | |
| 'enableClientValidation'=>true, | |
| 'clientOptions'=>array( | |
| 'validateOnSubmit'=>true, | |
| 'inputContainer'=>'.form-group', | |
| 'errorCssClass'=>'has-error', | |
| ), | |
| 'errorMessageCssClass'=>'help-block', | |
| )); ?> |