This file contains 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
open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security |
This file contains 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
{ | |
"auto_format_on_save": true, | |
"auto_format_on_save_excludes": [ | |
"/node_modules/", | |
"*.json", | |
"*.md", | |
"*.html" | |
], | |
"prettier_options": { |
This file contains 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, { createContext, useState } from 'react'; | |
import initialValues from './initial'; | |
const Context = createContext(initialValues); | |
const GlobalContext = ({ children }) => { | |
const [globalState, setGlobalState] = useState(initialValues); | |
return ( | |
<Context.Provider value={{ globalState, setGlobalState }}> |
This file contains 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
function limit_word_count($title) { | |
$len = 5; //change this to the number of words | |
if (str_word_count($title) > $len) { | |
$keys = array_keys(str_word_count($title, 2)); | |
$title = substr($title, 0, $keys[$len]); | |
} | |
return $title; | |
} | |
add_filter('the_title', 'limit_word_count'); |
This file contains 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
// Sometimes it's necessary to do a bit of clean-up | |
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) { | |
el.removeAttribute('data-confirm'); | |
el.click(); | |
}); |
This file contains 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
var instagramUrl = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=myToken&callback=?&limit=1&count=12'; | |
var recruiterboxUrl = 'https://jsapi.recruiterbox.com/v1/openings?client_name=myAccountName&limit=5'; | |
// Instagram Media Load | |
var loadFeed = function(url, callback) { | |
$.ajax({ | |
url: url, | |
dataType: 'json', | |
success: function(response) { |
This file contains 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
<?php | |
/** | |
* Get the terms of post | |
* @param object $p The post | |
* @param string $class CSS Class | |
* @param string $separator | |
* @return string The terms | |
*/ | |
function get_post_terms($p, $class = 'post-preview__cat', $separator = '') { |
This file contains 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
<?php | |
// Apply filter | |
add_filter('body_class', 'multisite_body_classes'); | |
function multisite_body_classes($classes) { | |
$id = get_current_blog_id(); | |
$slug = strtolower(str_replace(' ', '-', trim(get_bloginfo('name')))); | |
$classes[] = sanitize_title('site-'.$slug); | |
return $classes; | |
} |
This file contains 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
<!-- Loop com ID --> | |
<?php $my_query = new WP_Query('page_id=87'); | |
while ($my_query->have_posts()) : $my_query->the_post(); | |
$do_not_duplicate = $post->ID;?> | |
<div class="entry"> | |
<?php the_content(); ?> | |
</div> |
NewerOlder