Skip to content

Instantly share code, notes, and snippets.

View bunnywong's full-sized avatar
🙃
code for food

BunnY bunnywong

🙃
code for food
View GitHub Profile
@bunnywong
bunnywong / gist:f55188114f75c17e54b1
Last active August 29, 2015 14:19
Ubuntu Commond
# Apache
sudo chown -R $USER:$USER /var/www/lunch-together.xxx/public_html
sudo chmod -R 755 /var/www
a2ensite lunch-together.xxx
a2dissite lunch-together.xxx
service apache2 reload
service apache2 restart
- Apache
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
sudo chown -R $USER:$USER /var/www/lunch-together.xxx/public
sudo chmod -R 755 /var/www
sudo a2ensite lunch-together.xxx
- MySQL

Vagrant init

vagrant box add hashicorp/precise32
vagrant init sixlive/tjay-ubuntu-12-php-53

Apache

cd /etc/apache2/sites-available/
sudo a2ensite example.com.conf
sudo apt-get install php5-fpm
@bunnywong
bunnywong / gist:ed1ab5139fe17a5f213a
Created July 9, 2015 15:10
Wordpress MySQL migration code
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
nano ~/.bashrc
@bunnywong
bunnywong / gist:8cff633f9f97546c6fe1
Created July 10, 2015 09:52
Drupal Common Module
Token
Views
Devel
@bunnywong
bunnywong / gist:ed27baeaab308914a4e7
Last active August 29, 2015 14:24
TODO: Fix unique address not as default
SELECT
oc_customer.email AS 'email',
oc_customer.customer_id AS 'customer_cid',
oc_customer.address_id AS 'customer_addressId',
oc_address.customer_id AS 'address_cid',
oc_address.address_id AS 'address_addressId',
COUNT(oc_address.customer_id) as 'address_count'
FROM
oc_customer, oc_address
drush cc all
# Dump
drush sql-dump >dump.sql
drush sql-dump --gzip > ./sql/ime.sql.gz
# Login
drush uliSQL
Function
- check_plain() // Return pure text(html)