I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)
This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.
| import { forEachObjIndexed } from "ramda"; | |
| import * as React from "react"; | |
| import { | |
| Animated, | |
| ScrollView, | |
| View, | |
| ViewStyle, | |
| LayoutChangeEvent, | |
| NativeScrollEvent, | |
| } from "react-native"; |
| #### | |
| # ZSH function to auto-switch to correct Node version | |
| # https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5 | |
| # | |
| # - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does. | |
| # | |
| # - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING. | |
| # | |
| # - Works correctly if your .nvmrc file contains something relaxed/generic, | |
| # like "4" or "v12.0" or "stable". |
| import { Module, Global, DynamicModule } from '@nestjs/common' | |
| import { EnvModule } from './env.module' | |
| import { EnvService } from './env.service' | |
| import { TypeOrmModule } from '@nestjs/typeorm' | |
| function DatabaseOrmModule (): DynamicModule { | |
| const config = new EnvService().read() | |
| return TypeOrmModule.forRoot({ | |
| type: config.DB_TYPE, |
| <?xml version="1.0"?> | |
| <ruleset name="Laravel Standards"> | |
| <!-- | |
| The name attribute of the ruleset tag is displayed | |
| when running PHP_CodeSniffer with the -v command line | |
| argument. The description tag below is not displayed anywhere | |
| except in this file, so it can contain information for | |
| developers who may change this file in the future. | |
| --> |
| #!/bin/bash | |
| # NB: First install nscd with sudo apt-get install nscd | |
| # run this command to flush dns cache: | |
| sudo /etc/init.d/dns-clean restart | |
| # or use: | |
| sudo /etc/init.d/networking force-reload | |
| # Flush nscd dns cache: | |
| sudo /etc/init.d/nscd restart |
Laravel - Eloquent - query many to many relationship
Example:
Table 1: posts
Table 2: categories
Pivot Table: category_post with foreign keys category_id, post_id
| <?php | |
| add_action( 'gform_after_submission', 'braums_after_submission', 10, 2 ); | |
| function braums_after_submission( $entry, $form ) { | |
| ?> | |
| <script> | |
| function braums_datalayer_push() { | |
| var form_submission = sessionStorage.getItem('entry_<?php echo absint( $entry[ 'id' ] ); ?>'); | |
| if ( null == form_submission ) { | |
| if ( typeof( dataLayer ) != 'undefined' ) { | |
| dataLayer.push({'event': 'BWTrackEvent', |
| <?php | |
| //edit with your data | |
| $repo_dir = '~/repository.git'; | |
| $web_root_dir = '~/project'; | |
| $post_script = '~/project/scripts/post_deploy.sh'; | |
| $onbranch = 'master'; | |
| // A simple php script for deploy using bitbucket webhook | |
| // Remember to use the correct user:group permisions and ssh keys for apache user!! | |
| // Dirs used here must exists on server and have owner permisions to www-data |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Wheel of Fortune Bingo</title> | |
| <!-- | |
| MIT License |