Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# this script is using [email protected]:jwhitcraft/rome.git to build SugarCRM
echo "Starting $1 monitoring to build changes into $2"
fswatch -0 -x -r sugarcrm -e ".*___jb_tmp___" -e ".*___jb_old___" | {
while read -d "" event; do
sleep 0.022
case ${event} in
*Created*|*Updated*|*Renamed* )
repo=$(sed -E 's/ .* .* (IsFile|IsDir)//g' <<< ${event})
case ${repo} in
@klimslim
klimslim / SugarCronFilteredJobs.php
Created June 27, 2018 10:00 — forked from jhoffmann/SugarCronFilteredJobs.php
Both files go into custom/include/SugarQueue, then run a Repair to regenerate cache/file_map.php and you're good to go.
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once 'include/SugarQueue/SugarCronJobs.php';
require_once 'custom/include/SugarQueue/SugarJobFilteredQueue.php';
// Sample configuration:
//
@klimslim
klimslim / gist:72adb5e26f2c2c466c9f4aee443be152
Created October 10, 2017 10:03 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@klimslim
klimslim / warmup.php
Created October 9, 2017 10:03
Zend opcache warmup
<?php
$start = microtime(true);
$files = 0;
$errors = 0;
foreach (['/home/httpd/html/'] as $path) {
// Get the realpath and check it's valid
$path = realpath($path);
if (!$path) {
continue;
}
@klimslim
klimslim / gist:3121175
Created July 16, 2012 06:50 — forked from steegi/gist:2934001
Creating a SugarCRM DB2 developer database that works for all circumstances, but isn't suited for production
#!/bin/sh
# NOTE this creates a default 32k table space which is the maximum. Only a few tables in Sugar need 8k, others need only 4k
# However if you are using Studio the table needs enough extra space to add columns
# Also note that the specified collation is case insensitive US. By default DB2 is case sensitive.
db2 "CREATE DATABASE sugarult USING CODESET UTF-8 TERRITORY US COLLATE USING UCA500R1_LEN_S2 PAGESIZE 32 K"
# Sugar 6.4 and 6.5 need the Full Text Search engine up and running and operational.
@klimslim
klimslim / gist:3121171
Created July 16, 2012 06:49 — forked from steegi/gist:2934101
Script to drop all tables in a DB2 database
#/bin/sh
# Since there is no simple drop all tables from a database command in DB2,
# this script uses a few unix utilities to accomplish the same result
# Note that it assumes that your session is already connected to the database
# and that the schema from which you want to drop the tables has the same name
# as your current user.
db2 "Select 'DROP TABLE', TABLE_NAME from sysibm.tables WHERE TABLE_SCHEMA = UPPER('$USER')" | grep DROP | db2