This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // REQUIRES: | |
| // moment.js - http://momentjs.com/ | |
| // USAGE: | |
| // {{ someDate | moment: [any moment function] : [param1] : [param2] : [param n] | |
| // EXAMPLES: | |
| // {{ someDate | moment: 'format': 'MMM DD, YYYY' }} | |
| // {{ someDate | moment: 'fromNow' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| id, ( | |
| 3959 * acos ( | |
| cos ( radians(78.3232) ) | |
| * cos( radians( lat ) ) | |
| * cos( radians( lng ) - radians(65.3234) ) | |
| + sin ( radians(78.3232) ) | |
| * sin( radians( lat ) ) | |
| ) | |
| ) AS distance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mychat.find({ $or : [ { $and : [ { my_id : req.body.uid }, { user : req.body.oid } ] } , { $and : [ { my_id : req.body.oid }, { user : req.body.uid } ] } ] } ).exec( | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Taxonomies are basically a way of grouping data in WordPress. The most common default taxonomies used in WordPress are when grouping posts as either ‘categories’ or ‘tags’ and these are named and recorded in the WordPress database as ‘category’ and ‘post_tag’ respectively. Specific categories or tags are called terms. | |
| Many plugins and theme functionality will use their own custom taxonomies to group data together in a meaningful way. A photo gallery for example might have a taxonomy name ‘gallery_cat’ with terms such as ‘Sunsets’, ‘Portraits’, ‘Nature’ etc. Each term has an associated name, slug and term ID. | |
| To query WordPress and return posts based on these custom taxonomy names and terms, we can use ‘tax_query’ within get_posts() as indicated below: | |
| 01 | |
| 02 | |
| 03 | |
| 04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php /* Template Name: Hotel Custom */ ?> | |
| <?php | |
| $args = array( | |
| 'post_type' => 'hotel_listing', //remember this is-case sensitive | |
| 'posts_per_page' => -1, | |
| ); | |
| $releaseQuery = new WP_Query( $args ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TouchableOpacity style={styles.deal} onPress={this.handlePress}> | |
| <ImageBackground source={{uri: deal.media[0]}} style={styles.image} > | |
| <View style={{position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, justifyContent: 'center', alignItems: 'center'}}> | |
| <Text>{deal.title}</Text> | |
| </View> | |
| </ImageBackground> | |
| </TouchableOpacity> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pip3 install PyMySQL | |
| or | |
| pip install pymysql | |
| after then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pip3 install PyMySQL | |
| or | |
| pip install pymysql | |
| after then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Gmail API Quickstart</title> | |
| <meta charset="utf-8" /> | |
| </head> | |
| <body> | |
| <p>Gmail API Quickstart</p> | |
| <!--Add buttons to initiate auth sequence and sign out--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ipLookUp () { | |
| $.ajax('http://ip-api.com/json') | |
| .then( | |
| function success(response) { | |
| console.log('User\'s Location Data is ', response); | |
| console.log('User\'s Country', response.country); | |
| getAdress(response.lat, response.lon) | |
| }, | |
| function fail(data, status) { |
NewerOlder