> ./checkCountryName.sh China
People's Republic of China
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
#/usr/bin/env bash | |
# for a given directory myDirectory, create a list of all files within that directory | |
# note that file names are not enclosed in quotes here | |
find myDirectory -type f -exec echo {} \; > myDirectory.files.text | |
# if you want them in quotes, | |
# find myDirectory -type f -exec echo \"{}\" \; > myDirectory.files.text | |
# and a list of the sizes of each of these files | |
find myDirectory -type f -exec echo \"{}\" \; | xargs -n1 du -sh > myDirectory.files.sizes.text |
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
alias docker_kill_all='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker image rm $(docker image ls -q)' |
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 | |
commerce_order.order_id, | |
FROM_UNIXTIME(commerce_order.created) AS created, | |
GROUP_CONCAT(DISTINCT commerce_line_item.line_item_label) AS line_item_label, | |
GROUP_CONCAT(DISTINCT commerce_product.type) AS productType, | |
IF( | |
GROUP_CONCAT(DISTINCT commerce_product.type) = "bundle", | |
GROUP_CONCAT(DISTINCT bundleProduct.sku), | |
GROUP_CONCAT(DISTINCT commerce_product.sku) | |
) AS productSKUList, |
SuiteCRM contactCount Example
- Run the SQL from
fields_meta_data.sql
against the database to create the new custom field - Place PHP files into project, locations are noted in comment on each file. Definitions in
logic_hooks.php
will need to be manually merged into the existing file or else move these definitions to better follow the Extension framework. - Quick Repair and Rebuild
- Run the SQL from
updateContactCountExistingRecords.sql
against the database to populate the new custom field. Note that if custom fields have never been created, then the tableaccounts_cstm
will be empty and this update will fail, you'll need to first populate the table i.e.INSERT INTO accounts_cstm (id_c) SELECT id FROM accounts
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
#/usr/bin/env bash | |
CONNECTION_ID="" # grab from URL for a given HC Connection | |
TOKEN="" # grab from web requests within Heroku Connect | |
page=1 | |
keepGoing=1 | |
while [ $keepGoing -gt 0 ] | |
do | |
notice_url="https://connect-us.heroku.com/api/v3/connections/${CONNECTION_ID}/notifications?page=${page}" |
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
#!/usr/bin/env bash | |
PROFILE=yourFavoriteAwsProfile | |
REGION=us-east-1 | |
TABLE=origin-table | |
DEST_TABLE=destination-table | |
TABLE_DUMP=$(aws dynamodb scan --profile ${PROFILE} --region ${REGION} --table-name ${TABLE}) | |
TABLE_Items=`echo ${TABLE_DUMP} | jq -r '.Items'` |
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
#!/usr/bin/env bash | |
# USD $ 9168.57 | |
curl -s "https://api.coindesk.com/v1/bpi/currentprice.json" | jq .bpi.USD.rate_float | rev | cut -c 3- | rev | xargs echo "USD $" |
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 | |
function get_date($input) { | |
$dateObject = new DateTime($input); | |
if($dateObject->format('d') > 15) $dateObject->modify('+1 month'); | |
$dateObject->modify('first day of'); // set to start of month | |
$Start_Date__c = $dateObject->format('Y-m-d'); | |
$dateObject->modify('+1 year'); | |
$dateObject->modify('-1 day'); | |
$End_Date__c = $dateObject->format('Y-m-d'); |
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
#!/usr/bin/env bash | |
# https://stackoverflow.com/a/1456019 | |
# https://stackoverflow.com/a/12797512 | |
echo \ | |
`# comment zero` \ | |
'this is a test, ' `# comment one` \ | |
`# comment one point five` \ | |
'this is also a test' `# comment two` \ |