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
#/etc/hosts | |
127.0.0.1 my-site.dev | |
#/Applications/MAMP/conf/apache/httpd.conf | |
<VirtualHost *> | |
DocumentRoot "/Users/dannybot/sites/my-site" | |
ServerName my-site.dev | |
</VirtualHost> | |
#restart server dans MAMP |
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
cd /etc/apache2/sites-available | |
sudo pico yourdomain.dev.conf | |
<VirtualHost *:80> | |
ServerName yourdomain.dev | |
DocumentRoot /home/dev/sites/yourdomain | |
</VirtualHost> | |
sudo pico /etc/hosts |
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 | |
//top of page | |
$page_query = $wp_query; | |
//... do your stuff, call WP_Query, etc. | |
//reset $wp_query to current page | |
$wp_query = $page_query; | |
wp_reset_postdata(); |
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 | |
//functions.php | |
/** | |
* En gros, ce que tu fais c'est définir un path avec une regex, ici "custom-post-type/([^/]+)/?$" , qui correspond à "custom-post-type/anything-you-want" | |
* En ensuite tu redéfini les variables de l'objet $wp_query. Les variables sont accessibles dans ton fichier de thème avec la fonction get_query_var() | |
* Un bon outil pour tester les rewrites : http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/ | |
*/ | |
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
Here's the SQL statement that will find the closest 20 locations that are within a radius of 25 miles to the 37, -122 coordinate. It calculates the distance based on the latitude/longitude of that row and the target latitude/longitude, and then asks for only rows where the distance value is less than 25, orders the whole query by distance, and limits it to 20 results. To search by kilometers instead of miles, replace 3959 with 6371. | |
SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20; |
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
<div> | |
<a href="#" class="button"><span>Do Not Press This Button</span></a> | |
</div> | |
.button { | |
display: inline-block; | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; | |
border-radius: 10px; | |
-webkit-box-shadow: 0 10px 0 #823a17, 0 15px 20px rgba(0, 0, 0, .5); |
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
#!/usr/bin/env bash | |
# This is an RVM Project .rvmrc file, used to automatically load the ruby | |
# development environment upon cd'ing into the directory | |
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional. | |
environment_id="ruby-1.9.3-p0@inm" | |
# | |
# Uncomment the following lines if you want to verify rvm version per project |
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 | |
$response = array(); | |
$email = General::sanitize($postData['form']['email']); | |
$firstname = General::sanitize($postData['form']['firstname']); | |
$lastname = General::sanitize($postData['form']['lastname']); | |
if( isset($postData['form']['language']) && $postData['form']['language'] ){ | |
$language = General::sanitize($postData['form']['language']); | |
} else { |