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 searchBox = new google.maps.places.SearchBox(document.getElementById('searchinput')); | |
| google.maps.event.addListener(searchBox, 'places_changed', function() { | |
| var place = searchBox.getPlaces()[0]; | |
| if (!place.geometry) return; | |
| if (place.geometry.viewport) { | |
| map.fitBounds(place.geometry.viewport); | |
| } else { |
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 vote() { | |
| var opts = ['binay','duterte','poe','roxas','santiago']; | |
| var rand = Math.floor(Math.random() * (4 - 0 + 1)) + 0; | |
| var result = opts[rand]; | |
| return 'duterte'; | |
| } |
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
| class Car { | |
| constructor(make) { | |
| this.make = make; | |
| } | |
| drive() { | |
| console.log("Driving a " + this.make); | |
| } | |
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
| curl http://spark-cluster-ip:6066/v1/submissions/status/driver-20151008145126-0000 |
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
| def s3_to_http(url): | |
| if url.startswith('s3://'): | |
| s3_path = url | |
| bucket = s3_path[5:].split('/')[0] | |
| object_name = '/'.join(s3_path[5:].split('/')[1:]) | |
| return 'https://s3.amazonaws.com/{0}/{1}'.format(bucket, object_name) | |
| else: | |
| return url |
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
| if [ ! -z ${BUILD_TARGET} ] && [ "${BUILD_TARGET}" != "local" ]; then \ | |
| wget ${CLOUD_SQL_PROXY_URL} -O /usr/local/bin/cloud_sql_proxy; \ | |
| chmod +x /usr/local/bin/cloud_sql_proxy; \ | |
| echo "command=/usr/local/bin/cloud_sql_proxy" > /etc/supervisor/conf.d/cloud_sql_proxy.conf; \ | |
| fi |
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
| @import url('leaflet/dist/leaflet.css'); | |
| .leaflet-control-layers-toggle { | |
| background-image: url(/assets/img/layers.png); | |
| } | |
| .leaflet-retina .leaflet-control-layers-toggle { | |
| background-image: url(/assets/img/layers-2x.png); | |
| } |
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
| import flask | |
| import requests | |
| from flask import Flask | |
| from flask_restful import Resource, Api | |
| from PIL import Image, ImageDraw, ImageFont | |
| from io import BytesIO | |
| app = Flask(__name__) | |
| api = Api(app) |
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 | |
| while getopts u:d:p:b: option | |
| do | |
| case "${option}" | |
| in | |
| u) _USER=${OPTARG};; | |
| p) _PASSWORD=${OPTARG};; | |
| b) _BUILD=${OPTARG};; | |
| esac |
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
| import json | |
| def mapper(source, template): | |
| def _get(d, keys, splitter="."): | |
| if isinstance(keys, str): | |
| keys = keys.split(splitter)[1:] | |
| if not keys or d is None: | |
| return d |