This file contains hidden or 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
if ( class_exists( 'WPBakeryShortCodesContainer' ) ) { | |
class WPBakeryShortCode_Team_Wrapper extends WPBakeryShortCodesContainer { | |
} | |
} | |
if ( class_exists( 'WPBakeryShortCode' ) ) { | |
class WPBakeryShortCode_Team_Mate extends WPBakeryShortCode { | |
} | |
} |
This file contains hidden or 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
// Usage: | |
// get_id_by_slug('any-page-slug'); | |
function get_id_by_slug($page_slug) { | |
$page = get_page_by_path($page_slug); | |
if ($page) { | |
return $page->ID; | |
} else { | |
return null; | |
} |
This file contains hidden or 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
// Usage: | |
// get_id_by_slug('any-page-slug'); | |
function get_id_by_slug($page_slug) { | |
$page = get_page_by_path($page_slug); | |
if ($page) { | |
return $page->ID; | |
} else { | |
return null; | |
} |
This file contains hidden or 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
require.config({ | |
baseUrl: '/backbone-tests/', | |
paths: { | |
'jquery' : '/app/libs/jquery', | |
'underscore' : '/app/libs/underscore', | |
'backbone' : '/app/libs/backbone', | |
'mocha' : 'libs/mocha', | |
'chai' : 'libs/chai', | |
'chai-jquery' : 'libs/chai-jquery', | |
'models' : '/app/models' |
This file contains hidden or 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
// simple first class function | |
var fire = (name) => { | |
console.log(name) | |
} | |
// A new high order function which accepts another function as its parameter and | |
// calls another function with parameter which will be again passed on to high other order function as its parameter | |
var fireman = (method) => (firingObject) => { | |
method(firingObject) |
This file contains hidden or 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
const mapStateToProps = (state) => ({ user: state.user }); | |
const User = connect(mapStateToProps)(({ user }) => | |
<div className="User" > { user.name } - { user.status } </div> | |
); | |
const App = () => | |
<div className="App"> | |
<User /> | |
</div> |
This file contains hidden or 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
import React from 'react'; | |
import { | |
compose, | |
setDisplayName, | |
setPropTypes, | |
withState, | |
withHandlers, | |
lifecycle, | |
mapProps |
This file contains hidden or 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
import React from 'react'; | |
import { | |
compose, | |
setDisplayName, | |
setPropTypes, | |
withState, | |
withHandlers | |
} from 'recompose' | |
const {Component} = React; |
This file contains hidden or 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
import React from 'react'; | |
const { Component } = React; | |
import { compose, lifecycle, branch, renderComponent, withState } from 'recompose'; | |
function fetchData(){ | |
return new Promise((resolve) => { | |
setTimeout(() => resolve({ | |
name: 'superman ', |
This file contains hidden or 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
const webpack = require('webpack'); | |
const WebpackDevServer = require('webpack-dev-server'); | |
const config = require('./webpack.config'); | |
new WebpackDevServer(webpack(config), { | |
publicPath: config.output.publicPath, | |
hot: true, | |
historyApiFallback: true | |
}).listen(5050, 'localhost', (err) => { | |
if (err) { |