sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download zsh-autosuggestions by
$string = "MyString" | |
get-childitem | where-object {$_.Name -like "*$string*"} | foreach ($_) {remove-item $_.fullname} |
<?php | |
// Helper class to generate responsive image HTML from an id or array | |
class cameronjonesweb_generate_image { | |
public $output; | |
function __construct( $image, $size = 'full' ) { | |
if( is_array( $image ) ) { | |
// It's an array |
<?php | |
require 'recipe/common.php'; | |
// Set configurations | |
set('repository', 'ssh://[email protected]:22/user/repo.git'); | |
set('shared_files', ['public/wp-config.php']); | |
set('shared_dirs', ['public/wp-content/uploads']); | |
set('writable_dirs', []); | |
set('keep_releases', 10); | |
set('composer_command', 'composer'); |
This is a (partial) example to demonstrate the interaction between different reusable components to build an admin page in the WordPress back-end that shows a near-real-time display of the last 30 lines of my log files.
This code will not work as is, as some of it depends on a larger architecture system. Some of the files have been shortened, and the usual file headers and copyright notices have been removed for brevity's sake.
The related components that are discussed are brightnucleus/dependencies and brightnucleus/settings. The configuration is loaded through brightnucleus/config.
Notable "features" of the below code:
Before you go over the snippets I will summarize which functions are being used.
That's it! one function that would insert the image into the DB, create four copies with different sizes, and upload to the uploads directory. Regarding the arguments:
'image' is what holds all the data about the image. It comes from the POST request. In the JS file you will see what I mean.
'0' This is the $post_id. I set it to zero, because i'm not asigning this image to any post at the moment. In order for this function to work we need to add above it:
webpack.mix.js
file in root directory:const { mix } = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
if [ -f /usr/share/git-core/contrib/completion/git-prompt.sh ]; then | |
source /usr/share/git-core/contrib/completion/git-prompt.sh | |
fi |
#!/usr/bin/env bash | |
# =============================================================================== | |
# Script to install PHPUnit in the Local by Flywheel Mac app | |
# These packages are installed | |
# | |
# PHPUnit, curl wget, rsync, git, subversion and composer. | |
# | |
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit. | |
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory. |