Skip to content

Instantly share code, notes, and snippets.

@leeuwd
leeuwd / setup-ubuntu-akeneo-pim.md
Last active May 21, 2024 17:29
How to setup an Ubuntu server (i.e. DigitalOcean LAMP stack droplet) Akeneo PIM server.

How to setup the Akeneo server

# date: january 2018
# author: Dick de Leeuw (dick@leeuw.studio, @leeuwd)
# prerequisites: LAMP droplet (>= 8GB RAM)
# environment: Ubuntu 16.04.3 LTS xenial, Apache/2.4.29 (Ubuntu), MySQL 5.7.21 & PHP 7.1

# create droplet
@BenWoodford
BenWoodford / LeafAPI.md
Last active November 22, 2023 21:51
New Nissan Connect EV API

Late 2018 Update

I am no longer working on this as the new API is US-only as I'm in the UK, so cannot even use it or the new app. Please don't ask me questions about it as I honestly can't remember anything.

Nissan Connect EV 2018 API

This is a work in progress, just jotting down my findings from the APK decompile so far. As I can only read the decompiled Java and not MITM the app due it not working in the UK, getting the payload info may take a while. There's loads of API calls so this may not be thorough for a while.

Base URL: https://icm.infinitiusa.com/NissanLeafProd/rest

@robwent
robwent / mautic-wpml-lang.php
Last active February 22, 2020 18:41
Send WPML preferred language to Mautic
<?php
/*
Plugin Name: Mautic WPML Preferred Language
Plugin URI: https://www.robertwent.com/
Description: Sends WPML language preference to Mautic
Version: 1.0
Author: Robert Went
*/
function mautic_wpml_lang_init() {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
from lxml import html
import json
import requests
import json,re
from dateutil import parser as dateparser
from time import sleep
@gedex
gedex / woocommerce-woocommerce-gateway-amazon-payments-advanced-rest-api-doc.md
Last active October 30, 2018 15:59
WooCommerce Gateway Amazon Payments Advanced REST API introduced in 1.6.0

WooCommerce Gateway Amazon Payments Advanced REST API

The WooCommerce Gateway Amazon Payments Advanced REST API allows you to authorize, capture, and close authorization. The endpoint is /wp-json/wc/v1/orders/<order_id>/amazon-payments-advanced/.

List of orders paid via Amazon Payments

There's no custom endpoint to retrieve list of orders paid via Amazon Payments. The built-in orders point can be used with _payment_method=amazon_payments_advanced filter.

@norcross
norcross / disable-username-login.php
Last active July 11, 2017 19:44
Force a redirect if a certain username is attempted.
<?php
add_filter( 'authenticate', 'rkv_disable_username_logins', 20, 3 );
/**
* Disable admin username and redirect to Google (or another site).
*
* @param object $user The WP_User object.
* @param string $username The entered username.
* @param string $password The entered password.
*
@janeczku
janeczku / user-data.sh
Last active November 18, 2017 02:32
OVH Public Cloud - Cloud-Init bootstrap Failover IP + Docker
#!/bin/sh
cat > /etc/network/interfaces.d/eth0-0.cfg <<EOF
auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 178.32.XXX.XXX
netmask 255.255.255.255
broadcast 178.32.XXX.XXX
post-up /sbin/ip route replace default via $(/sbin/ip route | awk '/default/ { print $3 }') dev eth0 src 178.32.XXX.XXX
@temoto
temoto / Dockerfile
Last active June 20, 2023 08:34
File layout template for project with multiple docker containers in single repo
# I will eat you family and your dog if you use FROM ubuntu for container that runs a service in production
# Reading: http://phusion.github.io/baseimage-docker/
FROM phusion/baseimage:0.9.15
# inspired by https://github.com/progrium/buildstep
RUN mkdir /build
ADD ./files-build/ /build/
RUN chmod --recursive go-rwx /build
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive /bin/bash /build/prepare
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@yask123
yask123 / whatsapp_sendMSG.js
Created January 24, 2015 17:08
Send messages on whatsapp by Javascript
document.getElementsByClassName("input")[1].innerHTML="This message was written via JS script! "; // Fills the text box message
var input = document.getElementsByClassName("icon btn-icon icon-send");//Grabs the send button
input[0].click();// Clicks the send button
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();