Skip to content

Instantly share code, notes, and snippets.

View and1truong's full-sized avatar
🎯

Hong Truong and1truong

🎯
View GitHub Profile
@and1truong
and1truong / smartqueue_og_nodequeue_autocomplete.php
Created July 27, 2012 07:22
Implements hook_nodequeue_autocomplete()
<?php
/**
* Implements hook_nodequeue_autocomplete().
*/
function smartqueue_og_nodequeue_autocomplete($queue, $subqueue, $string, $where, $where_args) {
// Disable language selection temporarily, enable it again later.
if (module_exists('i18n')) {
i18n_selection_mode('off');
}
phploc ~/www/drupal/8/
phploc 1.6.4 by Sebastian Bergmann.
Directories: 342
Files: 1715
Lines of Code (LOC): 216374
Cyclomatic Complexity / Lines of Code: 0.07
Comment Lines of Code (CLOC): 83501
Non-Comment Lines of Code (NCLOC): 132873
Mozilla/5.0(iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5
diff -Naur nohack/sites/all/modules/ubercart/payment/uc_payment/uc_payment.module_11_07_2012 dev/sites/all/modules/ubercart/payment/uc_payment/uc_payment.module_11_07_2012
--- nohack/sites/all/modules/ubercart/payment/uc_payment/uc_payment.module_11_07_2012 1970-01-01 07:00:00.000000000 +0700
+++ dev/sites/all/modules/ubercart/payment/uc_payment/uc_payment.module_11_07_2012 2012-05-15 06:54:07.000000000 +0700
@@ -0,0 +1,828 @@
+<?php
+
+/**
+ * @file
+ * Defines the payment API that lets payment modules interact with Ubercart.
+ *
diff -Naur nohack/sites/all/modules/ubercart/uc_order/templates/uc_order-customer.tpl.php dev/sites/all/modules/ubercart/uc_order/templates/uc_order-customer.tpl.php
--- nohack/sites/all/modules/ubercart/uc_order/templates/uc_order-customer.tpl.php 2012-04-26 15:48:51.000000000 +0700
+++ dev/sites/all/modules/ubercart/uc_order/templates/uc_order-customer.tpl.php 2012-08-06 23:12:06.000000000 +0700
@@ -231,7 +231,15 @@
<b><?php echo $product->qty; ?> x </b>
</td>
<td width="98%">
- <b><?php echo $product->title .' - '. uc_price($price_info, $context); ?></b>
+ <b><?php echo $product->title .' - '. uc_price($price_info, $context); ?>
+ <?php
@and1truong
and1truong / tools.md
Created August 28, 2012 03:35
Tools used at Viet Coop
@and1truong
and1truong / irc.md
Created August 28, 2012 22:42
Cách sử dụng IRC ở VC
  1. Sử dụng vcbot để hỗ trợ cho các nhu cầu tra cứu, lưu trữ, …
  2. Toàn bộ VC tham gia channel chung.
  3. Mỗi team nhỏ sẽ tham gia channel tương ứng.

Lưu ý

  1. Không gửi thông tin nhạy cảm (thông tin cá nhân, password, …) trên các board, dầu là private.
  2. Các thông tin nhạy cảm, lưu ở Trello, rồi gửi link ở channel.
  3. Đăng ký nickname trước khi chính thức tham gia channel.
  4. Mention nick name của member khi cần họ lưu ý.
@and1truong
and1truong / drupal-bot.md
Created August 28, 2012 23:43
Drupal Bot

Drupal Bot là một project/tool trên nền Drupal, giúp Drupal có thể vận hành bot trên các kênh IRC, sử dụng Bot khéo léo, bot trở thành công cụ rất hiệu quả, rất thú vị.

Đây là một số lệnh để điều khiểm bot:

  1. Xem tình trạng bot: drush bot-status
  2. Reset tình trạng bot: drush bot-status-reset -y
  3. Start bot: drush bot-start
  4. Start bot deamon: nohup drush bot-start &
# Ref: http://drush.ws/examples/example.drushrc.php
# Ref: http://books.tag1consulting.com/scalability/drupal/start/backups
echo 'Including config file…'
if [ -f ./.config ]; then
. ./.config
fi
echo 'Getting database connection settings…'
CMD='foreach ($GLOBALS['"'"'databases'"'"']['"'"'default'"'"'] as $key => $info)';
name = "VC Go"
version = 7.x-1.x-dev
description = "Detect old URL, redirect to the new path."
core = 7.x