Skip to content

Instantly share code, notes, and snippets.

View onnayokheng's full-sized avatar

Onnay Okheng onnayokheng

View GitHub Profile
@onnayokheng
onnayokheng / get-thumbnail-youtube
Last active August 29, 2015 14:06
get youtube thumbnail from content
<?php
/* Get thumbnail from Video Embed code */
function nesia_get_video_image() {
global $post;
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $post->post_content, $match)) {
$video_id = $match[1];
} else {
return false;
}
@onnayokheng
onnayokheng / Amazing of WooCommerce
Last active August 29, 2015 14:01
Amazing of WooCommerce
Main Link --> http://www.woothemes.com/woocommerce/
See the video, it's great!
**See WooCommerce from Usability**
-------------------------------
- Discount
- Unlimited Coupon Code (http://take.ms/5wfoh)
- Variation Products (http://take.ms/SfGy6)
- SKU
- Price and Sale Price (http://take.ms/krx26)
var departure = new google.maps.LatLng(-6.18049, 106.82638); //Set to whatever lat/lng you need for your departure location
var arrival = new google.maps.LatLng(-6.17770, 106.82141); //Set to whatever lat/lng you need for your arrival location
var line = new google.maps.Polyline({
path: [departure, departure],
strokeColor: "#FF0000",
strokeOpacity: 0.7,
strokeWeight: 2,
geodesic: true, //set to false if you want straight line instead of arc
map: map,
});

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
((d, s, id) ->
js = undefined
fjs = d.getElementsByTagName(s)[0]
return if d.getElementById(id)
js = d.createElement(s)
js.id = id
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"
fjs.parentNode.insertBefore js, fjs
) document, "script", "facebook-jssdk"