Check NodeJS version
$ node --version
Search for available NodeJS versions
$ brew search node
Unlink currect NodeJS installation
Check NodeJS version
$ node --version
Search for available NodeJS versions
$ brew search node
Unlink currect NodeJS installation
| (function( $ ){ | |
| 'use strict'; | |
| function auto_fit_soliloquy( parent_selector ){ | |
| // resize the slider container | |
| var $soliloquy = $( parent_selector + ' .soliloquy-container'), | |
| $all_items = $('.soliloquy-slider,.soliloquy-viewport,.soliloquy-item', $soliloquy ), | |
| $container = $('.soliloquy-item', $soliloquy ), | |
| window_height = $(window).height(); |
| <?php | |
| function cur_target_sidebar_add_classes_to_params($params) { | |
| global $my_widget_num; // Global a counter array | |
| $sidebar_id = $params[0]['id']; | |
| if ( $sidebar_id == 'sidebar' ) { | |
| $registered_widgets = wp_get_sidebars_widgets(); | |
| if(!isset($registered_widgets[$sidebar_id]) || !is_array($registered_widgets[$sidebar_id])) { // Check if the current sidebar has no widgets |
| #!/bin/sh | |
| # credit from https://unix.stackexchange.com/questions/114908/bash-script-to-convert-all-flac-to-mp3-with-ffmpeg | |
| # credit from https://stackoverflow.com/questions/26109837/convert-flac-to-mp3-with-ffmpeg-keeping-all-metadata | |
| find . -type f -name '*.flac' -exec ffmpeg -i {} -ab 320k -map_metadata 0 -id3v2_version 3 -acodec libmp3lame {}.mp3 \; |
| #!/bin/sh | |
| # credit from http://stackoverflow.com/questions/6301885/convert-tar-gz-to-zip | |
| for f in *.tar.gz | |
| do | |
| rm -rf ${f%.tar.gz} | |
| mkdir ${f%.tar.gz} | |
| tar xvzf $f -C ${f%.tar.gz} | |
| zip ${f%.tar.gz}.zip -r ${f%.tar.gz} | |
| rm -rf ${f%.tar.gz} |
| find . -regextype posix-extended -regex ".*-[[:digit:]]{2,4}x[[:digit:]]{2,4}(@2x)?.(jpg|jpeg|png|eps|gif)" -type f -exec rm {} \; |
| // @link http://jsfiddle.net/andyshora/5YVNN/ | |
| // @link http://andyshora.com/css-image-container-padding-hack.html | |
| $(document).ready(function() { | |
| // when the image has loaded | |
| $('.image').load(function() { | |
| // remove loading class from the wrapper | |
| $(this).parent('.image-wrapper--loading').removeClass('image-wrapper--loading'); | |
| }); | |
| var imagePath = 'http://andyshora.com/assets/img/pages/grumpy-cat.jpg'; |
| <?php | |
| // Make Soliloquy sliders use wp's native responsive images with wp retina | |
| function my_theme_soliloquy_output($slider, $data) { | |
| return wp_make_content_images_responsive($slider); | |
| } | |
| add_filter('soliloquy_output', 'my_theme_soliloquy_output', 10, 2); | |
| // wp_make_content_images_responsive needs the img tags to have a class with their id | |
| function my_theme_soliloquy_image_slide_class($classes, $item, $i, $data, $mobile) { | |
| $classes[] = 'wp-image-' . $item['id']; |
| [submodule "chosen"] | |
| path = chosen | |
| url = git@github.com:harvesthq/chosen.git |
| // Const | |
| const webpack = require('webpack'); //to access built-in plugins | |
| const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
| const path = require('path'); | |
| // ExtractPlugin - Multiple instances | |
| // Configure individual stylesheet generation to use correctly with wp_enqueue_style | |
| const extractMain = new ExtractTextPlugin('css/main.min.css'); | |
| const extractAdmin = new ExtractTextPlugin('css/admin.min.css'); | |
| const extractEditor = new ExtractTextPlugin('css/editor.min.css'); |