Battery by @fei on dribbble: http://dribbble.com/shots/1209794-Battery
Forked from Felix De Montis's Pen Battery.
For more on the Battery API see David Walsh's article.
| global $post; | |
| $product_categories = get_the_terms( $post->ID, 'product_cat' ); | |
| foreach ( $product_categories as $product_category ) { | |
| echo $product_category->name; | |
| echo $product_category->slug; | |
| echo $product_category->term_id; |
| <snippet> | |
| <content><![CDATA[ | |
| { | |
| // REQUIRED (BASIC) FIELDS | |
| "main": "${1:index.html}", | |
| "name": "${2:nw-demo}", | |
| // OPTIONAL FIELDS |
| /* DEVELOPMENT */ | |
| NPM (npm) | |
| https://www.npmjs.org/search?q=%s | |
| Unheap (unheap) | |
| http://www.unheap.com/?s=%s | |
| /* GENERAL */ | |
| Search for english word on StackExchange |
| javascript:(function(){email=document.getElementById("username");email.value="enter_username_here";pass=document.getElementById("password");pass.value="enter_password_here";document.getElementsByTagName('form')[0].submit();})() |
Battery by @fei on dribbble: http://dribbble.com/shots/1209794-Battery
Forked from Felix De Montis's Pen Battery.
For more on the Battery API see David Walsh's article.
| /* | |
| <?php | |
| // THE FOLLOWING IMPLEMENTATION CAN BE USED FOR VARIOUS APIs. THIS WAS TESTED SUCCESSFULLY ON THE pingdom.com API | |
| $email = "your@mail.net"; | |
| $passwd = 'password'; | |
| $api_key = "API_KEY"; | |
| $curl = curl_init(); |
| (function(RGX_COMMENT, RGX_TRIM) { | |
| getComments = function (fn, opt_trim) { | |
| var comments = []; | |
| (fn + '').replace(RGX_COMMENT, function(m, a, b, c) { | |
| if (!c) { | |
| m = a == undefined ? b : a; | |
| comments.push(opt_trim ? m.replace(RGX_TRIM, '') : m); | |
| } | |
| }); | |
| return comments; |
| /* | |
| * Convert values: 1, 0, true, false, "1", "0", "true", "false", "TRUE", "FALSE", "True", "False" | |
| * "ON", "OFF", "On", "Off", negative numbers, positive numbers, to booleans with a single JS line. | |
| * Easily extensible with new truthy values. | |
| */ | |
| function checkBool(val){ | |
| return ({1:1,true:1,on:1,yes:1}[(((typeof val !=="number")?val:(val>0))+"").toLowerCase()])?true:false; | |
| }; |
| var http = require('http'); | |
| var fs = require('fs'); | |
| var file = fs.createWriteStream("image.jpg"); | |
| var request = http.get("http://domain.com/custom.jpg", function(res) { | |
| res.pipe(file); | |
| }); |
| var https = require('https'); | |
| var fs = require('fs'); | |
| var options = { | |
| hostname : 'wordpress.org', | |
| port : 443, | |
| path : '/latest.zip', | |
| method : 'GET' | |
| }; | |
| var file = fs.createWriteStream("wp_latest.zip"); |