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
var init = function () { | |
var data1, data2, data3, data4, data5, data6, data7, data8, data9, data10; | |
console.log('Start by waiting for a second...'); | |
window.setTimeout(function() { | |
console.log('Then send a GET request to a couple of websites'); | |
$.get('https://cors-test.appspot.com/test', function (data) { | |
data1 = data; |
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
var init = sync(function* (resume) { | |
var data1, data2; | |
console.log('Start by waiting for a second...'); | |
yield sleep(1000, resume); | |
console.log('Then send a GET request to a couple of websites with XMLHttpRequest'); | |
data1 = yield get('https://cors-test.appspot.com/test', resume); |
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 | |
function get_cars() { | |
$ne = $_REQUEST['northeast']; | |
$sw = $_REQUEST['southwest']; | |
$args = array( | |
'post_type' => 'car', | |
'post_status' => 'publish', | |
'meta_query' => array( |
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 | |
$query = new WP_Query([ | |
'meta_query' => [ | |
'relation' => 'AND', | |
[ | |
'key' => 'locationlat', | |
'value' => [$sw[0], $ne[0]], | |
'type' => 'numeric', | |
'compare' => 'BETWEEN' |
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
var getCars = function () { | |
$.getJSON(url, function(cars) { | |
var $list = $('#min-liste-med-biler'); | |
for (var i = 0; i < cars.length; i += 1) { | |
addCarToViewElm(cars[i], $list); | |
} | |
}); | |
}; | |
var addCarToViewElm = function (car, $elm) { |
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 | |
function ajax_get_cars() { | |
$ne = $_REQUEST['northeast']; | |
$sw = $_REQUEST['southwest']; | |
print_r(json_encode(get_cars($ne, $sq)); | |
die; | |
} |
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
$bounds = []; // bounds fra google maps | |
$query = new WP_Query([]); // din wp_query argumenter der henter alle posts ud | |
$markers_inside_bounds = []; | |
while ($query->have_posts()) { | |
$query->the_post(); | |
$lat = get_field('lat'); |
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 wp_2_posts.* FROM wp_2_posts WHERE 1=1 AND wp_2_posts.post_type = 'lease' AND (wp_2_posts.post_status = 'publish' OR wp_2_posts.post_status = 'private') ORDER BY wp_2_posts.post_date DESC |
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 | |
add_filter('posts_where', 'unique_areas', 10, 2); | |
function unique_areas($where, $query) { | |
global $wpdb; | |
$where .= " AND DISTINCT {$wpdb->postmeta}.meta_value"; | |
return $where; | |
} |
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
sass | |
sass/ "echo ' compiling...' && sass --update -t compressed sass/%s.scss:css/%s.css" | |
gomake | |
. "go build && [ $? -eq 0 ] && echo 'No errors' && rm %s" |