Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Configuration:
DRUPAL_ROOT=/home/langgo/demo/langgo
DRUPAL_DIR=$DRUPAL_ROOT/sites/langgo
DB_BACKUP_FILE="https://raw.github.com/gist/5f39454c80939a29d425/f2045d53d15d41f2f8cfbc8570dfdb243667fb76/test.sql"
DRUSH_MAKE_FILE="https://raw.github.com/gist/b84fd6235b58779398c5/3324cbb4faa4d3c39a3af6b26ea7cf418c9ab00f/test.make"
ROOT_USER_NAME="root"
ROOT_USER_PASS="root"
DB_NAME="langgo_db"
#!/bin/sh
# Configuration:
PATH_CONFIG="$HOME/vietcoop"
FILE_ARG="$1"
#check file config
if [ ! -f "$PATH_CONFIG/$FILE_ARG" ]
then
echo -e "Not found file config at '$PATH_CONFIG/$FILE_ARG'"
exit
#!/bin/sh
# Configuration:
PATH_CONFIG="$HOME/vietcoop"
FILE_ARG="$1"
#check file config
if [ ! -f "$PATH_CONFIG/$FILE_ARG" ]
then
echo -e "Not found file config at '$PATH_CONFIG/$FILE_ARG'"
1.could not access PID file for nginx ... failed!
$ sudo fuser -k 80/tcp ; sudo /etc/init.d/nginx restart
drush scr
http://ac.buzzwoo.de/
2.resulotion
cvt 1280 1024
xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
@drushman
drushman / gist:3780086
Created September 25, 2012 05:00
Phân tích module Dictionary diemtuaonline
Về dữ liệu
Database gồm
1.feedback
2.log
3.setting
4.subject
5.words
6.words_class
7.word_subject
@drushman
drushman / gist:3792605
Created September 27, 2012 07:04
entity_field_collection
Bellow is the example for dynamically creating/deleting/modifying field-collection item for any node.
Suppose 'field_page_collection1' is the field collection for the 'page' content type having two text fields 'field_page_collection1_text1', 'field_page_collection1_text2'.
To attach or create field-collection item for node having node id 1.
<?php
$node = node_load(1);
$field_collection_item = entity_create('field_collection_item', array('field_name' => 'field_page_collection1')); // Create new field collection item.
@drushman
drushman / node_field_collection_save.php
Created September 27, 2012 07:29 — forked from mrconnerton/node_field_collection_save.php
How to programtically save a node with field collections
<?php
// Lets just pretend your content type is "Event" with machine name "event"
$node = new stdClass();
$node->type = 'event';
node_object_prepare($node);
$node->title = "My event title";
$node->language = LANGUAGE_NONE;
@drushman
drushman / gist:3798806
Created September 28, 2012 09:12
comerce braintree
** use service Recurring Billing of braintree
Here’s how we will do that:
Create a Plan
create Customer and Use the Customer ID to retrieve the credit card from the Vault
Subscribe the Customer to the Plan
Confirm the Customer subscription
@drushman
drushman / gist:3816982
Created October 2, 2012 07:11
UPS Shipping
1. Download and enable commerce_shipping, commerce_shipping_ui, commerce_ups, physical, commerce_physical
2.
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.