Skip to content

Instantly share code, notes, and snippets.

@dodie
dodie / magento2_recreate_catalogsearch.php
Last active Sep 17, 2019
PHP script to recreate the mg3_catalogsearch_fulltext_scope1 table for Magento 2.
View magento2_recreate_catalogsearch.php
<?php
try {
require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
echo $e->getMessage();
exit(1);
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
View fun-simple.md

Example where functional style can simplify our lives.

Source: Dr. Venkat Subramaniam - Functional Programming with Java 8 (https://www.youtube.com/watch?v=Ee5t_EGjv0A)

Goal: calculate the double of the first even number greater than 3

var numbers = [1,2,3,4,5,6,7,8,9,10];
View fun-composition.md
View fun-intro-outline.md

#FP intro

Lambda calculus, Alonzo Church, '30

JS:

  • functional: Lisp (1958, John McCarthy, fun) -> Scheme (1970, Guy L. Steele, fun) -> JS
  • OO: Smalltalk (1972, Alan Kay, OO) -> Self (1987, David Ungar, OO, prototype) -> JS
  • syntax, API: C -> Java -> JS
View gist:f2c558c13ad29e165bf2
Where 0 is the Xvfb screen number:
DISPLAY=:0 import -window root screenshot.png
View Terminal env
TERM=xterm-256color