Skip to content

Instantly share code, notes, and snippets.

@getsudocode
getsudocode / disqus_embed.js
Last active July 9, 2018 18:58
disqus embeded code
var disqus_config = function () {
this.page.url = '{{url absolute="true"}}'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "ghost-{{comment_id}}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
@getsudocode
getsudocode / post.hbs
Last active July 10, 2018 07:45
Ghost part of post.hbs to add Disqus embed code
<footer class="post-full-footer">
 …
</footer>
 <section class="post-full-comments">
 {{! - Add disqus Universal Embed Code here - }}
 </section>
</article>
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
#map {
height: 100%;
}
html, body {
height: 100%;
<script>
let map;
// define global array to store markers added
let markersArray = [];
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
map.addListener('click', function(e) {
console.log(e);
addMarker(e.latLng);
});
let map;
let markersArray = [];
// define global variable to store polyline
let polyline = null;
function initMap() {
...
map.addListener('click', function(e) {
//console.log(e);
addMarker(e.latLng);
function addMarker(latLng) {
let marker = new google.maps.Marker({
map: map,
position: latLng,
draggable: true
});
// add listener to redraw the polyline when markers position change
marker.addListener('position_changed', function() {
drawPolyline();
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
#map {
height: 100%;
}
html, body {
height: 100%;
let map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
let marker = new google.maps.Marker({
map: map,
position: {lat: -34.397, lng: 150.644},
@getsudocode
getsudocode / color_marker_function.js
Last active July 19, 2018 12:26
change JavaScript Google Map marker color
let map;
// global array to store the marker object
let markersArray = [];
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
addMarker({lat: -34.297, lng: 150.544}, "yellow");