Skip to content

Instantly share code, notes, and snippets.

View unlocomqx's full-sized avatar
🏠
Working from home

Tuni-Soft unlocomqx

🏠
Working from home
  • Module Dev - Tuni-Soft
  • [object Object]
View GitHub Profile
SELECT di.inputs FROM ps_dynamicproduct_input di
LEFT JOIN ps_customized_data cd ON di.id_customization = cd.id_customization
LEFT JOIN ps_customization cu ON cu.id_customization = cd.id_customization
LEFT JOIN ps_orders o ON o.id_cart = cu.id_cart
JOIN ps_order_detail od ON o.id_order = od.id_order
WHERE o.id_order = 12 AND di.id_customization = 57
const red = chalk.bold.red;
const green = chalk.bold.green;
const blue = chalk.bold.blue;
const error = console.error;
const log = console.error;
const info = console.info;
console.error = function(){
error(red.apply(console, arguments));
@unlocomqx
unlocomqx / ts-loader-with-jetbrains-console.js
Created December 3, 2017 11:21
to be used with a run configuration
module: {
rules: [
{
test: /\.ts?$/,
loader: 'ts-loader',
exclude: /node_modules|tests/,
options: {
errorFormatter : function customErrorFormatter(error, colors) {
const messageColor = error.severity === 'warning' ? colors.bold.yellow : colors.bold.red;
const relative_path = path.relative(process.cwd(), error.file);
/**
* Function that mutates original webpack config.
* Supports asynchronous changes when promise is returned.
*
* @param {object} config - original webpack config.
* @param {object} env - options passed to CLI.
* @param {WebpackConfigHelpers} helpers - object with useful helpers when working with config.
**/
export default function (config, env, helpers) {
helpers.setHtmlTemplate(config, 'src/index.html');
<?php
$product = new Product($id_product);
$category_file = "./category{$product->id_category_default}.php";
if (is_file($category_file)) {
include_once $category_file;
}
function dp_calculation(data) {
console.log(data.result_formatted);
}
/* Angular lib automated publish to git remote */
// add the following scripts to the package.json inside lib folder projects/new-lib
/*
"scripts": {
"publish": "npm version patch && npm run build && npm run release",
"build": "ng build --prod new-lib",
"release": "node publish.js"
},
*/
/* Angular lib automated publish to git remote */
// the dist/new-lib folder is your git repo
// git init && git remote add origin <remote_url>
// add the following scripts to the package.json inside lib folder projects/new-lib
/*
"scripts": {
"publish": "npm version patch && npm run clean && npm run build && npm run release",
"clean": "cd ../../dist/new-lib && ls -a -I \".git\" | xargs rm -rf || true",
@unlocomqx
unlocomqx / arduino-split-str.cpp
Created August 20, 2018 18:43
A simple function to take a string chunk in arduino
String getChunk(String str, String delimiter, int index) {
int prev_idx = 0;
int idx = 0;
String temp = str;
String chunk;
int i = 0;
do {
idx = temp.indexOf(delimiter);
debug("idx =", String(idx));
chunk = temp.substring(prev_idx, idx);
Index: views/js/front/modules/custom-text.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- views/js/front/modules/custom-text.js (revision 643b48eeb49ae38e07453e3300d0a1bdc176365e)
+++ views/js/front/modules/custom-text.js (revision 0422aa7a43934064811730eb6fae4edfa62161da)
@@ -373,6 +373,7 @@
'data-text': values.text
})