- https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes
- https://www.reddit.com/r/laravel/comments/3to60i/50_laravel_tricks/
- 1. Automatic Model Validation
// Put this script in your functions.php | |
// I have very little pages, and I am sure it can be improved | |
// or adjusted to suit your own project. | |
//Deregister the scripts. | |
function deregister_contact_form() { | |
// You can put here all the pages where there is no contact form | |
if ( ! is_page( 'contact' ) ) { | |
remove_action('wp_enqueue_scripts', 'wpcf7_enqueue_scripts'); | |
} |
<?php | |
function dee_display_recent_posts() { | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page'=> 5, | |
'cat'=> 4, | |
); | |
$dee_recent_posts = new WP_Query( $args ); | |
import React, { Component } from 'react'; | |
import TextField from 'components/base/TextField'; | |
const WAIT_INTERVAL = 1000; | |
const ENTER_KEY = 13; | |
export default class TextSearch extends Component { | |
constructor(props) { | |
super(); |
<style> | |
div.questions {padding:4em 0; clear:both} | |
div.questions h2 {font-size:2em; color:#111} | |
div.questions ul {margin:2em auto; max-width:800px; padding:0; list-style:none; font-size:1em; line-height:3em} | |
div.questions ul li {border-top:1px solid #DDD} | |
div.questions ul li a {color:#07F; border-bottom:1px solid transparent; -webkit-transition:border-color 0.5s ease-in-out; -moz-transition:border-color 0.5s ease-in-out; -o-transition:border-color 0.5s ease-in-out; transition:border-color 0.5s ease-in-out} | |
div.questions ul li a:hover {border-color:#07F} | |
div.faqs {background-color:#DDD; padding:1em 0; clear:both} | |
div.faqs dl {width:100%; max-width:800px; margin:0 auto} | |
div.faqs dl dt {font-size:3em; color:#111; margin:0 0 1em 0; padding-top:2em} |
jQuery(document).ready(function() { | |
function bs_fix_vc_full_width_row(){ | |
var $elements = jQuery('[data-vc-full-width="true"]'); | |
jQuery.each($elements, function () { | |
var $el = jQuery(this); | |
$el.css('right', $el.css('left')).css('left', ''); | |
}); | |
} |
<!-- http://codex.wordpress.org/Template_Tags/wp_get_archives --> | |
<!-- Technique #1 --> | |
<!-- This function is useful when you need to display content, excerpt, custom fields, or anything related to the post beyond it's link and title. If you just need a list of linked titles, see the next technique. Put the following function in functions.php --> | |
function recent_posts($no_posts = 10, $excerpts = true) { | |
global $wpdb; |
brew update | |
brew upgrade | |
brew tap homebrew/dupes | |
brew tap homebrew/versions | |
brew tap homebrew/homebrew-php | |
brew install php71 | |
## To use PHP7.1 on CLI, add this to .bash_profile |
import React, { Component } from 'react'; | |
import { TextInput } from 'react-native'; | |
class Input extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
text: '' | |
}; | |
} |
First install Brew on your MAC
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew tap homebrew/dupes
brew tap homebrew/php
brew install php70
mcrypt
: brew install mcrypt php70-mcrypt
brew install composer