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
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| source ~/.bashrc | |
| source ~/.scripts/.git-completion.bash | |
| #for adding branch to the terminal | |
| export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
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
| Host production | |
| Hostname production.example.com | |
| User ubuntu | |
| IdentityFile ~/secretlocation/example.pem | |
| Host staging | |
| Hostname staging.example | |
| User deploy |
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
| if(Yii::app()->user->isSuperuser) | |
| $type=$_POST['Type'];</div> | |
| else | |
| $type='User'; | |
| $authorizer = Yii::app()->getModule("rights")->getAuthorizer(); | |
| $authorizer->authManager->assign($type, $model->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
| $data_entry_users=Yii::app()->getAuthManager()->getAssignmentsByItemName('DataEntry'); | |
| $data_entry_users_id=array(); | |
| foreach($data_entry_users as $id=>$assignment) | |
| $data_entry_users_id[]=$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
| $roles=Rights::getAssignedRoles(Yii::app()->user->Id); | |
| foreach($roles as $role) | |
| echo $role->name."<br />"; |
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_dump(Yii::app()->getModule("rights")->getAuthorizer()->getSuperusers()); |
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
| if(Yii::app()->user->isSuperuser) | |
| echo "I am one of the superuser of application, I have all access to app."; |
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
| 'user'=>array( | |
| // | |
| // | |
| 'identityCookie' => array('domain' => '.domain.com'), | |
| // | |
| ), | |
| 'session' => array( | |
| 'autoStart'=>true, | |
| 'cookieParams' => array('domain' => '.domain.com'), | |
| ... |
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
| dgg : will delete to the beginning of the file. | |
| d$ : will delete from the current position to the end of the current line. | |
| dG : will delete to the end of the file. | |
| d0 : will delete to the beginning of the file | |
| dw: will delete a word |
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
| >> ActiveSupport::SecureRandom.base64(10) | |
| => "Fa8ILYFgMA12LA==" | |
| >> ActiveSupport::SecureRandom.hex(6) | |
| => "82c82a15110a" | |
| >> ActiveSupport::SecureRandom.random_bytes(16) | |
| => "u[\205\326\2654\301;'\340\372\2539r\035\313" | |
| >> ActiveSupport::SecureRandom.random_number(5) | |
| => 0 |
NewerOlder