-
Make sure you have already installed apache and mysql;
-
install rails
sudo apt install rails- install common dependencies
| #!/bin/bash | |
| sudo apt remove composer | |
| sudo apt update | |
| sudo apt install curl | |
| sudo curl -s https://getcomposer.org/installer | php | |
| sudo mv composer.phar /usr/bin/composer |
Make sure you have already installed apache and mysql;
install rails
sudo apt install rails| <?php | |
| /** | |
| * I was having trouble with socket connections timing out reliably. Sometimes, | |
| * my timeout would be reached. Other times, the connect would fail after three | |
| * to six seconds. I finally figured out it had to do with trying to connect to | |
| * a routable, non-localhost address. It seems the socket_connect call would | |
| * not fail immediately for those connections. This function is what I finally | |
| * ended up with that reliably connects to a working server, fails quickly for | |
| * a server that has an address/port that is not reachable and will reach the |
| <?php | |
| class SecureSessionHandler extends SessionHandler { | |
| protected $key, $name, $cookie; | |
| public function __construct($key, $name = 'MY_SESSION', $cookie = []) | |
| { | |
| $this->key = $key; | |
| $this->name = $name; |
| import csv | |
| import datetime | |
| import feedparser # pip install feedparser | |
| import html2text # pip install html2text | |
| from pygithub3 import Github # pip install pygithub3 | |
| # USAGE: Create a csv with all columns from Redmine and fetch | |
| # your API key from Redmine. Then use the code below to match | |
| # properties of the csv with properties of your GitHub issues. | |
| # Note: remove the first line of the exported CSV. |
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't:
| <!-- This is a Node+WebSocket powered demo to sync videos | |
| across different browsers. This file is the client, | |
| the other one is the Node server. Powered by Node and | |
| http://github.com/miksago/node-websocket-server --> | |
| <style> | |
| .inactive { display: none; } | |
| .active { display: block; } | |
| </style> | |
| <script> |