Skip to content

Instantly share code, notes, and snippets.

View joebordes's full-sized avatar

Joe Bordes joebordes

View GitHub Profile
@Luke1982
Luke1982 / Tar corebos
Last active September 17, 2019 09:41
tar --exclude="./backup" --exclude="./config.inc.php" --exclude="./.git" --exclude="./.gitignore" --exclude="./install" --exclude="./install.php" -cvzf corebos.tar.gz . > /dev/null &
@Luke1982
Luke1982 / finetuning-product-service-autocomplete-corebos.md
Last active July 28, 2021 09:57
Fine-tuning the Products/Services autocomplete

Fine-tuning the Products/Services autocomplete

There has been an update that will allow you to fine-tune the autocomplete for products and services. Let's dive in and explain how you can set the options:

First off: selecting the fields the autocomplete searches in

By default, typing something in the product lines will fire a search in the following fields by default:

Products

  • productname
  • manufacturer part no
  • vendor part no
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@h4cc
h4cc / array_filter_key.php
Created October 6, 2014 12:29
Filtering a PHP array by key instead of value.
<?php
/**
* Filtering a array by its keys using a callback.
*
* @param $array array The array to filter
* @param $callback Callback The filter callback, that will get the key as first argument.
*
* @return array The remaining key => value combinations from $array.
*/
@getify
getify / gist:8459026
Last active August 9, 2020 04:09
example: refactoring some code (in keystonejs) from "callback hell"-style to asynquence-style
var doQuery = function() {
count.exec(function(err, total) {
if (err) return sendError('database error', err);
query.exec(function(err, items) {
if (err) return sendError('database error', err);
sendResponse({
@getify
getify / only-gate.js
Last active July 10, 2018 12:42
asynquence: sequences & gates at a glance. https://github.com/getify/asynquence
ASQ()
.all( // or .gate(..)
// these 3 run "in parallel"
function(done){ setTimeout(done,100); },
function(done){ setTimeout(done,200); },
function(done){ setTimeout(done,300); }
)
.then(function(){
alert("All tasks are complete, and that only took ~300ms, not 600ms!");
});