Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <?php | |
| $data_json = json_encode(array('one','two','three','four','five','six','seven','eight','nine')); | |
| $data_with_delimiter = "one|two|three|four|five|six|seven|eight|nine"; | |
| /* | |
| |------------------------------------------------------------------------------ | |
| | Performance test # 1 | |
| |------------------------------------------------------------------------------ | |
| */ |
| #!/bin/bash | |
| if [ ! -f /swapfile ]; then | |
| sudo fallocate -l 1G /swapfile | |
| echo -e "\e[32mSWAP file created.\e[39m" | |
| else | |
| echo -e "\e[33mSWAP file already exist.\e[39m" | |
| fi | |
| if ! [[ `swapon -s | grep /swapfile` ]]; then |
| <?php | |
| $dns = 'mysql:dbname=mysql;host=localhost'; | |
| $db_user = 'root'; | |
| $db_password = 'admin'; | |
| $db_handler = new PDO($dns, $db_user, $db_password); | |
| $statment = $db_handler->query('SHOW DATABASES'); | |
| $dbs = $statment->fetchAll(); |
| <?php | |
| class Slug | |
| { | |
| /** | |
| * @param string $string | |
| * @return string | |
| */ | |
| public function make($string) | |
| { |
| <?php | |
| use RuntimeException; | |
| class VerifyEmail | |
| { | |
| /** | |
| * @var string | |
| */ | |
| protected $email_user = ''; |
| #!/bin/bash | |
| echo "[BUILD] start" | |
| CURRENT_DIR="$( cd "$( dirname "$0" )" && pwd )" | |
| echo "[BUILD] current directory is $CURRENT_DIR" | |
| if ! command -v php >/dev/null; then | |
| echo "[BUILD] php is required" | |
| echo "[BUILD] finish" | |
| exit 1 |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| POSTGRESQL | |
| $ sudo su postgres -c psql postgres | |
| postgres=# ALTER USER postgres WITH PASSWORD 'password'; | |
| postgres=# \q | |
| $ sudo passwd -d postgres | |
| $ sudo su postgres -c passwd |
| def multipliers(): | |
| return [(lambda y: (lambda x: x * y))(i) for i in range(4)] | |
| print [m(2) for m in multipliers()] |