I hereby claim:
- I am borivojevic on github.
- I am borivojevic (https://keybase.io/borivojevic) on keybase.
- I have a public key ASBVmSWmCh9Adh3YwcrzJw_m0z7gBLydbx28mTLu3yyRiwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| const testLocalStorage = () => { | |
| const mod = 'karius'; | |
| try { | |
| localStorage.setItem(mod, mod); | |
| localStorage.removeItem(mod); | |
| return true; | |
| } catch (e) { | |
| return false; | |
| } | |
| } |
| var FOTI = function () { | |
| return { | |
| name : "Peter Foti", | |
| init : function() { | |
| alert('Initializing!'); | |
| } | |
| }; | |
| }(); // Self invoking | |
| window.onload = FOTI.init; |
| public function login() { | |
| if ($this->request->is('post')) { | |
| if ($this->Auth->login() || $this->_loginWithEmail()) { | |
| $this->_setCookie($this->Auth->user('id')); | |
| $this->redirect($this->Auth->redirect()); | |
| } else { | |
| $this->Session->setFlash(__('Invalid username or password, try again')); | |
| } | |
| } |
| <?php | |
| // See http://php.net/manual/en/function.array-key-exists.php | |
| $search_array = array('first' => null, 'second' => 4); | |
| // returns false | |
| isset($search_array['first']); | |
| // returns true | |
| array_key_exists('first', $search_array); |
| # See http://stackoverflow.com/q/7566416/124644 | |
| git log --left-right --graph --cherry-pick --oneline devel...next |
A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).
| # Print models count | |
| ls app/Model/ | grep .php | wc -l | |
| # Print lines of code count | |
| git ls-files | xargs cat | wc -l |
| # Generating a key pair | |
| ssh-keygen -t rsa | |
| # Install the public key on the server | |
| ssh-copy-id -i .ssh/id_rsa.pub username@sub.domain.tld | |
| # Create local alias for ssh to sub.domain.tld | |
| echo "ssh -t username@sub.domain.tld \"cd application/webroot/directory ; bash\"" > ~/connect/sub.domain.tld | |
| # Connecting to server in day-to-day use | |
| ./connect/sub.domain.tld |
| ssh me@myserver | |
| cd repository.git | |
| sudo chmod -R g+ws * | |
| sudo chgrp -R mygroup * |