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
import 'dart:typed_data'; | |
import 'dart:async'; | |
import 'dart:math' as math; | |
enum AcknowledgementResult { | |
AckReceived, | |
NakReceived, | |
CrcCommand, | |
EotReceived, |
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 | |
LOG=/var/www/path_to/log/access.log | |
COUNTS=`/usr/bin/tail -5000 $LOG | grep -iv "Cloudflare-Healthchecks\|M2ePro\|UptimeRobot\|api\| 403 \|googlebot\|AdsBot-Google\|bing\|png\|jpg\|gif\|svg\|css\|js" | awk {'print $1'} | sort | uniq -c | sort -rn | head -1 | awk {'print $1'}` | |
IPADDRESS=`/usr/bin/tail -5000 $LOG | grep -iv "Cloudflare-Healthchecks\|M2ePro\|UptimeRobot\|api\| 403 \|googlebot\|AdsBot-Google\|bing\|png\|jpg\|gif\|svg\|css\|js" | awk {'print $1'} | sort | uniq -c | sort -rn | head -1 | awk {'print $2'}` | |
COUNTRY=`/usr/bin/geoiplookup $IPADDRESS | grep Country | awk {'print $5'}` | |
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
$pattern = "/\d+[A-Za-z]{0,1}[ ](?:[A-Za-z0-9'.-]+[ ]?)+(?:Alley|Ally|Arcade|Arc|Avenue|Av|Ave|Boulevard|Blv|Blvd|Bvd|Bypass|Bypa|Circuit|Circle|Cir|Ct|Cct|Close|Cl|Corner|Crn|Court|Ct|Crt|Crescent|Cres|Crs|Cul-de-sac|Cds|Drive|Dve|Dr|Esplanade|Esp|Gardens|Green|Grn|Grove|Gr|Heights|Highway|Hwy|Junction|Jnc|Lane|Lane|Link|Link|Loop|Mews|Mews|Outlook|Pane|Parade|Pde|Place|Pl|Ridge|Rdge|Rise|Road|Rd|Square|Sq|Street|ST|St|Terrace|Tce|The|Way|Walk|Box|Driftway)\.?/"; |
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
import FreeCAD | |
import Part | |
def create_adapter_plate(): | |
# Define Nema17 dimensions | |
width = 42.3 | |
length = 42.3 | |
bolt_diameter = 4.0 | |
shaft_diameter = 5.0 | |
height = 10.0 |
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
import FreeCAD | |
import Part | |
def create_adapter_plate(): | |
# Define Nema17 dimensions | |
width = 42.3 | |
length = 42.3 | |
bolt_diameter = 4.0 | |
shaft_diameter = 5.0 | |
height = 10.0 |
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 urlsafe_b64encode($string) { | |
return str_replace(array('+','/','='),array('-','_',''), base64_encode($string)); | |
} | |
$ampBaseUrl="https://www-example-com-au.cdn.ampproject.org"; | |
$file = fopen("urls.txt", "r") or exit("Unable to open file!"); |
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 | |
type_id,sku, cpev.value, | |
CASE when cpei2.value = 1 THEN "Enabled" ELSE "Disabled" END | |
from catalog_product_entity a | |
left join catalog_category_product cp on cp.`product_id` = a.entity_id | |
left join catalog_product_relation cpr on cpr.child_id = a.entity_id | |
left join catalog_product_entity_int cpei on cpei.`entity_id` = a.entity_id AND cpei.attribute_id = '91' #visibility | |
left join catalog_product_entity_int cpei2 on cpei2.`entity_id` = a.entity_id AND cpei2.attribute_id = '84' #status | |
left join catalog_product_entity_varchar cpev on cpev.`entity_id` = a.entity_id AND cpev.attribute_id = '60' #name | |
where |
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
Attribute IDs 32, 178 for Fax | |
Attribute IDs 31, 175 for Phone | |
update customer_address_entity_varchar set value = '' where attribute_id in (32,178) and value != ''; | |
update customer_address_entity_varchar set value = '' where attribute_id in (31,175) and (value REGEXP '^[A-Za-z]+$' OR value like ('%@%')); |
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 from Store 6 into Store 5 where position = 2; | |
INSERT INTO catalog_product_entity_media_gallery_value | |
( | |
value_id, | |
store_id, | |
label, | |
position, | |
disabled | |
) |
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
UPDATE am_shopby_value | |
SET img_medium = Concat(Lower(REPLACE (meta_title, ' ', '-')), '.jpg') | |
WHERE img_medium = '' | |
AND filter_id = 1 | |
AND meta_title NOT LIKE ( "a:%" ); |
NewerOlder