This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install ruby-dev | |
$ sudo gem install bundle | |
$ sudo gem install guard | |
$ sudo gem install guard-livereload | |
cd to project folder | |
$ bundle init | |
open .Gemfile, add following: | |
gem 'guard' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -sS https://getcomposer.org/installer | php | |
$ sudo mv composer.phar /usr/local/bin/composer | |
$ composer global require "laravel/installer=~1.1" | |
$ export PATH="$PATH:$HOME/.composer/vendor/bin" | |
$ laravel new app-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update -y | |
sudo apt-get install php7.1-curl php7.1-cli php7.1-dev php7.1-gd php7.1-intl php7.1-mcrypt php7.1-json php7.1-mysql php7.1-opcache php7.1-bcmath php7.1-mbstring php7.1-soap php7.1-xml php7.1-zip -y | |
sudo mv /etc/apache2/envvars /etc/apache2/envvars.bak | |
sudo apt-get remove libapache2-mod-php5 -y | |
sudo apt-get install libapache2-mod-php7.1 -y | |
sudo cp /etc/apache2/envvars.bak /etc/apache2/envvars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'company', | |
'post_status' => 'publish', | |
'posts_per_page' => 100, | |
'meta_query' => array( | |
'relation' => 'AND', | |
'sponsored_clause' => array( | |
'key' => 'sponsored' | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_ajax_add_notifier_email', 'add_notifier_email'); | |
function add_notifier_email() { | |
$post_id = (int)$_POST['company_id']; | |
$email = sanitize_email($_POST['email']); | |
if (is_numeric($post_id) && $email) { | |
$emails = get_field('email_notifiers', $post_id); | |
$emails[] = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ for id in $(wp post list --post_type=company --fields=ID); do wp eval "update_field('upgraded', true, $id);"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://app.codility.com/demo/results/trainingTVUZAM-A4K/ | |
function solution(A) { | |
// write your code in JavaScript (Node.js 8.9.4) | |
if (!Array.isArray(A)) return; | |
let res = 0; | |
for (let i of A) { | |
res ^= i; | |
} | |
return res; | |
} |