This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// php -f field_xml_builder.php > fields_xml.xml | |
$fields = array( | |
'Action', | |
'ActionDate', | |
'Address1', | |
'Address2', | |
'Address3', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assumes a top-level dir. structure like to: | |
# /. | |
# /.git/ (git is up here so all of the below are tracked) | |
# /.gitignore (this file) | |
# /crm/ (holds the Sugar/Suite application files) | |
# /db/ (holds database backups, or at least fields_meta_data and config and similar) | |
# /scripts/ (holds helper scripts for automated backups of database, quick repair, etc.) | |
# Ignore cache, but make sure it exists | |
crm/cache/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mailhog_setup = <<-SCRIPT | |
rm ~/.profile | |
apt-get update | |
apt-get install -y golang-go | |
echo "export GOPATH=$HOME/gocode" >> ~/.profile | |
source ~/.profile | |
go get github.com/mailhog/MailHog | |
go get github.com/mailhog/mhsendmail | |
cp ~/gocode/bin/MailHog /usr/local/bin/mailhog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "What do you want?" . PHP_EOL; | |
$handle = fopen("php://stdin","r"); | |
$input = fgets($handle); | |
echo "You want " . $input . PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://www.hackerrank.com/challenges/binary-search-tree-1/problem | |
select | |
parents.n, | |
case | |
-- if there is no parent to this node, then it is the root of the tree | |
when parents.p is null then 'Root' | |
-- if there are no children to this node, then it is a leaf | |
when children.nodes is null then 'Leaf' | |
-- otherwise it much be a branch | |
else 'Inner' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"repositories": [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "matthewpoer/unit-tests", | |
"version": "dev-7_6_1", | |
"dist": { | |
"url": "https://github.com/matthewpoer/unit-tests/archive/7_6_1.zip", | |
"type": "zip", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy the text out of the native function | |
var selectAll = selectNone.toString(); | |
// replace "checked=false" with "checked=true" | |
selectAll = selectAll.replace(/checked=false/g, 'checked=true'); | |
// rename the function | |
selectAll = selectAll.replace(/function selectNone/g, 'function selectAll'); | |
// the text var selectAll now contains a new function, so calling eval make it accessible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set up LAMP stack tailored on Ubuntu 16.04 LTS to latest version of SugarCRM 6.5 | |
# (as of 2017-07-23 that's 6.5.26; 6.5 is EoL as of 2017-07-15) | |
# sources | |
# https://developer.sugarcrm.com/2016/01/04/using-packer-to-create-consistent-sugar-hosting-environments/#more-12929 | |
# https://launchpad.net/~ondrej/+archive/ubuntu/php/ | |
# http://support.sugarcrm.com/Resources/Supported_Versions/ | |
# Stack Setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sugar_config_si = array( | |
'setup_db_host_name' => 'localhost', | |
'setup_db_sugarsales_user' => 'sugarcrm', | |
'setup_db_sugarsales_password' => 'DB_USER_PASSWORD', | |
'setup_db_database_name' => 'sugarcrm', | |
'setup_db_type' => 'mysql', | |
'setup_db_pop_demo_data' => false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
accounts.id as account_guid, | |
accounts.name as account_name, | |
accounts.parent_id as parent_account_guid, | |
parents.name as parent_account_name | |
from accounts | |
join accounts parents | |
on parents.deleted = 0 | |
and accounts.parent_id = parents.id | |
where accounts.deleted = 0 |