Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
<?php
function free_and_premium() {
vc_map( array(
"name" => __("Premium", "js_composer"),
"base" => "premium",
"content_element" => true,
"category" => "content>",
"show_settings_on_create" => false,
"params" => array(
// add params same as with any other content element
@mhasan3
mhasan3 / shortcode.md
Created May 26, 2015 16:18
Adding shortcodes to visual composer.

Shortcodes in Visual Composer

For example you have your own shortcode "hello_name":

function hello($atts, $content) {

extract(shortcode_atts( array(

'salutation' => !empty($salutation) ? $salutation : 'Mr.', 
// Not Working for Defaults
vc_map(array(
"name" => __("Google Map Holder", "js_composer") ,
"icon" => YES_ADDON_ASSETS_URL ."images/yes-icon.png",
"weight" => 21,
"base" => "map_holder",
"description" => __("Add all locations inside this container", "js_composer") ,
"as_parent" => array(
'only' => 'map_location'
) ,
@jsantell
jsantell / message-bus.js
Last active June 8, 2016 04:22
message-bus.js
/*
* CONTENT THREAD
*/
let responses = new Map();
let listener = ({ id, response }) => {
let callback = responses.get(id);
if (callback) {
responses.delete(id);
callback(response);
}
@katopz
katopz / nginx_docker.partial.conf
Created May 2, 2016 05:18
Use nginx to forward proxy to Parse Docker at 192.168.99.100 // $ nano /usr/local/etc/nginx/nginx.conf // $ sudo nginx -t && sudo nginx -s relo
server {
listen 1337;
server_name localhost;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@mikedfunk
mikedfunk / test.php
Created March 20, 2014 23:41
phpdoc and psr-2 class example
<?php
/**
* Description
*
* @package RacingJunk
* @copyright 2014 Internet Brands, Inc. All Rights Reserved.
*/
namespace InternetBrands\RacingJunk;
/**
@sapegin
sapegin / footer.php
Created August 7, 2012 19:10
RequireJS in Wordpress theme
@lunelson
lunelson / SassMeister-input.scss
Last active September 7, 2017 14:29
iOS 7 vh unit workaround MIXIN
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
/*
_ ______ _ __ _
(_) |___ / | | / _(_)
_ ___ ___ / /_______ _| |__ ______| |_ ___ __
@ircmaxell
ircmaxell / collection.php
Last active October 19, 2017 14:47
Monads - PHP
<?php
class CollectionMonad extends Monad {
public function __construct(array $value) {
$this->value = $value;
}
public function bind($callback) {
$newValues = array();
foreach ($this->value as $value) {
$newValues[] = $this->callCallback($callback, $value);
@jfitzsimmons2
jfitzsimmons2 / Wordpress Bootstrap 3 nav.php
Last active November 10, 2017 15:01
How to structure your WP <nav> tag using wp_nav_menu to use Bootstrap 3's navbar. Note this is specifically for the "fixed top" version of the navbar (http://getbootstrap.com/components/#navbar-fixed-top). Also only works for single-level navs. If there are sub-menus, additional tweaking is needed.
<nav id="site-navigation" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><?php bloginfo( 'name' ); ?></a>