Install the OpenSSL on Debian based systems
sudo apt-get install openssl
<?xml version="1.0" encoding="utf-8"?> | |
<CianFeed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<feed_version>2</feed_version> | |
<object> | |
<ExternalId>1e42aea4-1538-ec11-a3ff-001dd8b71dec</ExternalId> | |
<Category>newBuildingFlatSale</Category> | |
<Address>г. Москва, Волоколамское шоссе, влд. 71/12</Address> | |
<Coordinates /> | |
<Phones> | |
<PhoneSchema> |
WITH m AS ( | |
SELECT MAX(e.salary) max_salary, e.department_id | |
FROM employees AS e | |
GROUP BY e.department_id | |
) | |
SELECT e.first_name, e.last_name, e.salary, | |
d.name as department_name | |
FROM employees AS e | |
JOIN departments AS d ON e.department_id = d.id | |
WHERE EXISTS(SELECT 1 FROM m WHERE e.salary = m.max_salary AND e.department_id = m.department_id) |
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"sync" | |
"time" | |
) |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" |
FROM php:7-fpm | |
RUN apt-get update && \ | |
apt-get install -y \ | |
zlib1g-dev \ | |
libfreetype6-dev \ | |
libjpeg62-turbo-dev \ | |
libmcrypt-dev \ | |
libpng12-dev |
If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need.
Thus, you should keep the .vim
directory along with your .vimrc
version-controlled.
But when you have plugins installed inside .vim/bundle
(if you use pathogen), or inside .vim/pack
(if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.
Initialize a git repository inside your .vim
directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:
cd ~/.vim
Translations: Korean (by Yongwoo Lee)
Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.
I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class AddTrigger extends Migration | |
{ | |
public function up() | |
{ | |
DB::unprepared(' |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)