1. Install and start mongo service [official docs]
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
<?php | |
$items_per_page = 2; | |
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1; | |
$offset = ( $page * $items_per_page ) - $items_per_page; | |
$query = 'SELECT * FROM '.$table_name; | |
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table"; | |
$total = $wpdb->get_var( $total_query ); |
// Function form the react-native-image-picker library | |
ImagePicker.showImagePicker({ title: 'Select Image' }, (response) => { | |
// format the image data | |
const image = { | |
uri: response.uri, | |
type: 'image/jpeg', | |
name: 'myImage' + '-' + Date.now() + '.jpg' | |
} | |
// Instantiate a FormData() object | |
const imgBody = new FormData(); |
alexcvzz.vscode-sqlite | |
andys8.jest-snippets | |
apollographql.vscode-apollo | |
austincummings.razor-plus | |
bobsparadox.seti-black | |
BriteSnow.vscode-toggle-quotes | |
christian-kohler.npm-intellisense | |
christian-kohler.path-intellisense | |
CoenraadS.bracket-pair-colorizer | |
dbaeumer.vscode-eslint |
<?php | |
/* | |
* https://wpml.org/wpml-hook/wpml_active_languages/ | |
*/ | |
function press_wpml_language_selector() { | |
if (!is_front_page() && is_home()) { | |
$url = get_post_type_archive_link('post'); | |
$output = ''; | |
$langs = [ |
(function ($) { | |
function scaleCaptcha() { | |
$('.ginput_container.ginput_recaptcha').each(function () { | |
var self = $(this), | |
width = $(this).parent().width(); | |
if (width < 302) { | |
var scale = width / 302; | |
self.css('transform', 'scale(' + scale + ')'); | |
self.css('-webkit-transform', 'scale(' + scale + ')'); |
# Enable colors and change prompt: | |
# apple | |
autoload -U colors && colors | |
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " | |
# History in cache directory: | |
HISTSIZE=10000 | |
SAVEHIST=10000 | |
HISTFILE=~/.cache/zsh/history |
/* | |
* WP REST API version 2.0-beta7 | |
* API base url ishttp://www.example.com/wp-json | |
* | |
* Reference | |
* https://wordpress.org/support/topic/new-post-with-image | |
*/ | |
/* | |
* Get Guzzle HTTP Client. That client has been authenticated. | |
*/ |
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
/** | |
* This file contains the fix. | |
*/ | |
/*global wc_add_to_cart_variation_params, wc_cart_fragments_params */ | |
/*! | |
* Variations Plugin | |
*/ | |
;(function ( $, window, document, undefined ) { |