Skip to content

Instantly share code, notes, and snippets.

View jrodriguez-ifuelinteractive's full-sized avatar

Jesus Rodriguez jrodriguez-ifuelinteractive

View GitHub Profile
#!/bin/bash
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 744 cron.sh
chmod 744 mage
@jrodriguez-ifuelinteractive
jrodriguez-ifuelinteractive / delete_orders.sql
Last active August 29, 2015 14:21
Magento Delete Orders
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
@jrodriguez-ifuelinteractive
jrodriguez-ifuelinteractive / delete_customers.sql
Last active August 29, 2015 14:21
Magento Delete Customers
SET FOREIGN_KEY_CHECKS=0;
-- reset customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
http://kvz.io/blog/2013/01/16/vagrant-tip-keep-virtualbox-guest-additions-in-sync/
+ vagrant plugin install vagrant-vbguest - In same directory of Vagrantfile
+ sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions - If mount fails
@interface NSString (MD5)
- (NSString *)MD5String;
@end
override func viewDidLoad()
{
...
self.automaticallyAdjustsScrollViewInsets = true
...
}

JS Regex

/src=["|'](.*\.js)[\"|\']/gi

CSS Regex

/href=["|'](.*\.css)[\"|\']/gi
@jrodriguez-ifuelinteractive
jrodriguez-ifuelinteractive / setup.sh
Created January 17, 2017 13:17
Ubuntu 1.14.x Lamp Stack Config
#!/bin/bash
sudo apt-get -qq update
sudo apt-get install -y python-software-properties
sudo apt-get install -y build-essential
sudo apt-get install -y zip
sudo apt-get install -y apache2
sudo apt-get install -y curl
#MySQL
@jrodriguez-ifuelinteractive
jrodriguez-ifuelinteractive / tls.php
Created June 26, 2018 14:12
TLS Version Checker
<?php
$ch = curl_init('https://www.howsmyssl.com/a/check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
echo "Connection uses " . $json->tls_version ."\n";
<?php
$dateString = '2019-01-21';
$originTimezone = 'America/New_York';
$date = new DateTime($dateString, new DateTimeZone($originTimezone));
$offset = $date->getOffset();
$utc = new DateTime($dateString, new DateTimeZone('UTC'));
$interval = new DateInterval(sprintf('PT%sS', abs($offset)));