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:516e9a6d01c82e331d43
Created March 12, 2015 15:52
Opencart - Fix reward as product price
UPDATE oc_order_product SET reward = total
WHERE name LIKE '%以上%'
AND (quantity * price - reward) < 0
@bunnywong
bunnywong / gist:6fc72139a5adb7d3f8f9
Created March 12, 2015 15:50
Query offer products
SELECT *, (quantity * price - reward) AS rewardDiff
FROM `oc_order_product`
WHERE `name` LIKE '%以上%'
AND (quantity * price - reward) < 0
ORDER BY rewardDiff
@bunnywong
bunnywong / gist:f1600573ad4afbfa1d5d
Last active August 29, 2015 14:15
My Sublime quick key (Default)
----- SELECT -----
Ctrl Shfit + A = Select inner <tag>
----- ADD -----
Alt Shfit + W = Create new <tag>
----- REMOVE -----
Ctrl Shfit + K = Remove tail <tag>
Ctrl K , Ctrl + backspace = Del to head
Ctrl K, Ctrl K, = Del to end
@bunnywong
bunnywong / Embed youtube CSS in Drupal
Last active August 29, 2015 14:11
Embed youtube CSS in Drupal
.field-item {
position: relative;
padding-bottom: 56.25%; /* - 16:9 aspect ratio (most common) */
/* padding-bottom: 62.5%; - 16:10 aspect ratio */
/* padding-bottom: 75%; - 4:3 aspect ratio */
padding-top: 30px;
height: 0;
overflow: hidden;
}