Skip to content

Instantly share code, notes, and snippets.

@nestoru
nestoru / InternationalizeDiviBlurbModule.php
Created May 25, 2020 15:00
Internationalize Divi Blurb Module
...
if ( '' !== $title ) {
$title = sprintf(
'<%1$s class="et_pb_module_header">%2$s</%1$s>',
et_pb_process_header_level( $header_level, 'h4' ),
et_core_esc_previously( $title )
);
// starts blurb i18n patch
$plain_source_title = strip_tags( $title );
$plain_target_title = esc_html__($plain_source_title, 'et_builder');
@nestoru
nestoru / InternationalizeDiviButtonModule.php
Created May 25, 2020 14:59
Internationalize Divi Button Module
...
// Render Button
$button = $this->render_button( array(
'button_id' => $this->module_id( false ),
'button_classname' => explode( ' ', $this->module_classname( $render_slug ) ),
'button_custom' => $button_custom,
'button_rel' => $button_rel,
'button_text' => esc_html__( $button_text, 'et_builder' ), // button i18n
...
@nestoru
nestoru / InternationalizeDiviTabsModule.php
Created May 25, 2020 14:57
Internationalize Divi Tabs Module
public function get_tabs_nav() {
global $et_pb_tab_titles;
global $et_pb_tab_classes;
$tabs = '';
$i = 0;
if ( ! empty( $et_pb_tab_titles ) ) {
foreach ( $et_pb_tab_titles as $tab_title ){
// The below block is necessary to internationalize the tab titles
mongod --profile=1 --slowms=0
.contact-us-main{
min-height: 100vh;
}
.contact-us-submit-btn {
color: #FFFFFF;
background-color: #000000;
border-radius: 0px;
font-size: 11pt;
letter-spacing: 2px;
@nestoru
nestoru / zaproxy-install.sh
Last active June 8, 2019 12:49
OWASP Zed Attack Proxy (ZAP) AKA zaproxy installation
TODAY=`date +%Y-%m-%d`
INSTALL_DIR=~/
cd $INSTALL_DIR
git clone https://github.com/zaproxy/zaproxy.git
cd zaproxy/
./gradlew :zap:distDaily
cd zap/build/distributions/
unzip ZAP_D-${TODAY}.zip
cd ZAP_D-${TODAY}/
## Manual steps
@nestoru
nestoru / runInPods.sh
Last active November 4, 2019 17:35
Run any statement/command in all k8s pods with name matching a regex within a given context (kubectl config view )
#!/bin/bash -e
# runInPods.sh
# @description run any statement in all k8s pods with name matching a regex within a given context (kubectl config view ).
# @author Nestor Urquiza
# @date 20180929
#
# @example1 For my-project, in my-cluster, in pods named '*nodejs*', run the 'ps -ef | grep node' command
# ./runInPods.sh -c gke_my-project_us-east1-b_my-cluster -r nodejs -s "ps -ef | grep node"
#
@nestoru
nestoru / mongodb
Last active September 10, 2018 16:45
MAC MongoDB installation
# select one of available versions
brew search mongodb
# install
brew install [email protected]
# add executable to your path
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
. ~/.bash_profile
# create db path
sudo mkdir -p /data/db
sudo chown -R `id -un` /data/db
@nestoru
nestoru / Ubuntu MongoDB install
Last active September 3, 2020 08:42
Ubuntu MongoDB install
# Mongo 3
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv BC711F9BA15703C6
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3-4.list
sudo apt-get update
sudo apt-get install -y mongodb-org=3.0.16 mongodb-org-server=3.0.16 mongodb-org-shell=3.0.16 mongodb-org-mongos=3.0.16 mongodb-org-tools=3.0.16
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
@nestoru
nestoru / ubuntu-google-chrome-install.sh
Last active September 7, 2018 23:39
Ubuntu Google Chrome Install
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable