#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl torTor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
| /* | |
| Filename: azure-sql-read-only-user.sql | |
| Purpose: Create a read-only login user on a target database to enable the access to the data, but disable any insert, update, delete operations. | |
| Author: | |
| Oscar Garcia @ozkary | |
| Reference: |
| <?php | |
| use PhpCsFixer\Config; | |
| use PhpCsFixer\Finder; | |
| $rules = [ | |
| 'array_indentation' => true, | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'binary_operator_spaces' => [ | |
| 'default' => 'single_space', |
#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl torTor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php php-curl torTor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
Do the below and never try this again!
valet uninstall
composer global remove laravel/valet
sudo rm /usr/local/bin/valet
sudo rm -r ~/.valet
* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.
Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.
Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.
That's the theory, let's get to the work.
| /** | |
| * Convert the ResultSet to a List of Maps, where each Map represents a row with columnNames and columValues | |
| * @param rs | |
| * @return | |
| * @throws SQLException | |
| */ | |
| private List<Map<String, Object>> resultSetToList(ResultSet rs) throws SQLException { | |
| ResultSetMetaData md = rs.getMetaData(); | |
| int columns = md.getColumnCount(); | |
| List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>(); |