type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| <script setup> | |
| import paper from "paper" | |
| import { ref, onMounted } from 'vue' | |
| const canvas = ref(null) | |
| onMounted(()=>{ | |
| paper.setup(canvas.value); | |
| var path = new paper.Path(); | |
| path.strokeColor = 'black'; |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| <?php | |
| namespace App\Providers; | |
| use Illuminate\Support\Collection; | |
| use Illuminate\Pagination\LengthAwarePaginator; | |
| class AppServiceProvider extends ServiceProvider | |
| { | |
| public function boot() |
| #!/usr/bin/env bash | |
| # Upgrade an Amazon Linux EC2 to PHP 7.3 | |
| # | |
| # Last tested w/ PHP 7.2 AWS Linux version 2.8.5 | |
| # | |
| # Must be ran as sudo: | |
| # sudo bash upgrade-php7.sh | |
| # | |
| # Can be added to ./.ebextensions/20_php.config like so: | |
| # container_commands: |
| FROM php:7.0.4-fpm | |
| RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
| mysql-client libmagickwand-dev --no-install-recommends \ | |
| && pecl install imagick \ | |
| && docker-php-ext-enable imagick \ | |
| && docker-php-ext-install mcrypt pdo_mysql |
| #!/bin/bash | |
| apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
| apt-get update | |
| apt-get install -y docker-engine | |
| systemctl enable docker | |
| usermod -aG docker ubuntu | |
| curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" | |
| chmod +x /usr/local/bin/docker-compose | |
| docker-compose -v |
| <?php | |
| /* | |
| This code snippet can be added to your functions.php file (without the <?php) | |
| to add a query string to the login link emailed to the user upon registration | |
| which when clicked will validate the user, log them in, and direct them to | |
| the home page. | |
| */ | |
| /** | |
| * This first function is hooked to the 'user_register' action which fires |
| #!/usr/bin/env php | |
| <?php | |
| //usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page | |
| set_time_limit(0); | |
| $dir = $argv[1]; | |
| $source = $argv[2]; | |
| print_r($argv); | |
| mkdir ($dir); | |
| $src = file_get_contents($source); | |
| $pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i'; |
| function get_avatar_from_service(service, userid, size) { | |
| // this return the url that redirects to the according user image/avatar/profile picture | |
| // implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
| // for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
| // for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
| // for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
| // for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
| // for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
| // everything else will go to the fallback | |
| // google and gravatar scale the avatar to any site, others will guided to the next best version |