Skip to content

Instantly share code, notes, and snippets.

View montrealist's full-sized avatar
📺

Max Kovalenkov montrealist

📺
  • Montreal
View GitHub Profile
@montrealist
montrealist / box-api-wrapper.js
Last active December 19, 2017 19:10
box-node-sdk: search for file first and if it exists upload new version
const fileName = 'something.txt';
client.search.query (
fileName, { limit: 1 },
function(error, data) {
if (
data.total_count &&
data.total_count > 0 &&
data.entries[0].name === fileName
) {
// have a match - upload new version
@montrealist
montrealist / composer.json
Created December 23, 2019 01:41
Overriding a package in composer.json with a branch on your fork
{
"repositories": [
{
"type": "git",
"url": "[email protected]:montrealist/new-private-project.git"
}
],
"require-dev": {
"pressbooks/new-private-project": "dev-bugfixes"
}
alias.gip=git pull
alias.df=diff
alias.br=branch --all
alias.st=status
alias.plog=log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
alias.ac=!git add -A && git commit
alias.pom=push origin master
<?php
add_action('init', function () {
add_filter('wpml_elementor_widgets_to_translate', 'wpml_translate_widget_retina_image_20200714');
});
function wpml_translate_widget_retina_image_20200714($widgets)
{
$widgets['uael-marketing-button'] = [
'conditions' => ['widgetType' => 'uael-marketing-button'],
<?php
// 'EAE - Price Table' widget from https://wordpress.org/plugins/addon-elements-for-elementor-page-builder/
add_action('init', function () {
add_filter('wpml_elementor_widgets_to_translate', 'wpml_translate_widget_price_table_20200714');
});
function wpml_translate_widget_price_table_20200714($widgets)
{
WordPress database error Table 'wvaxcnmwju.gt0b_icl_translate' doesn't exist for query SELECT j.rid,
j.translator_id,
t.translation_id,
s.batch_id,
j.translated,
j.manager_id,
s.status,
s.needs_update,
s.translation_service,
s.uuid,
<?php
register_post_type( 'tutorial', array(
'labels' => array(
'name' => __( 'Tutoriais' ),
'singular_name' => __( 'Tutorial' ),
'add_new' => __( 'Criar Novo' ),
'add_new_item' => __( 'Criar Novo Tutorial' ),
'edit_item' => __( 'Editar Tutorial' ),
'new_item' => __( 'Novo Tutorial' ),
This file has been truncated, but you can view the full file.
Array
(
[hide_upgrade_notice] => 4.3.3
[icl_capabilities_verified] => 1
[active_languages] => Array
(
[0] => en
[1] => fr
[2] => us
)
@montrealist
montrealist / create-local-wp-mamp-site-mac.md
Last active December 10, 2020 16:44
Steps for creating a local MAMP site on Mac

Updated MAMP and it's no longer working?

/Applications/MAMP/conf/apache/httpd.conf needs this line to be uncommented:

# Virtual hosts
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Also MAMP might replace this file with a default version, so make sure to back it up.