This file contains 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 infoBubble = new InfoBubble({ | |
padding: 10, | |
borderRadius: 4, | |
arrowSize: 0, | |
arrowPosition: 30, | |
arrowStyle: 2 | |
}); | |
for(var i=0;i<data.length;i++) | |
{ |
This file contains 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
for(var i=0;i<data.length;i++) | |
{ | |
var lat = data[i].latitude; | |
var lng = data[i].longitude; | |
var latLng = new google.maps.LatLng(lat, lng); | |
var marker = new google.maps.Marker({map: map, position: glatLng}); | |
markersArray.push(marker); | |
// Set an attribute on the marker, it can be named whatever... | |
marker.html = '<div>My content goes here for ['+lat+', '+lng+']</div>'; |
This file contains 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 markersArray = []; | |
// For sake of simplicity, I'm assuming you're using jQuery | |
// data variable that contains latitudes and longitudes of positions | |
for(var i=0; i<data.length; i++){ | |
var glatLng = new google.maps.LatLng(data[i].latitude, data[i].longitude); | |
var marker = new google.maps.Marker({map: map, position: glatLng}); | |
markersArray.push(marker); | |
var $p = $('<p />'); | |
This file contains 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 get_token_and_login_url(self, redirect_uri): | |
"""Gets the oAuth token via the oauth2 library.""" | |
data = urllib.urlencode({'oauth_callback': redirect_uri if redirect_uri else 'oob'}) |
This file contains 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
$fh = fopen($box->download_url('862161200'), 'r'); // Open box.net file | |
$tmp = tempnam('/tmp', uniqid().'.docx'); // create tmp file | |
print_r($tmp); | |
echo '<br />'; | |
$tfh = fopen($tmp, 'w'); | |
fwrite($tfh, fread($fh, 13421772)); // write bytes from box.net file to tmp file | |
fseek($tfh, 0); | |
// Then load tmp file into ZipArchive->open() and use this function: | |
http://www.botskool.com/geeks/how-extract-text-docx-or-odt-files-using-php |
This file contains 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
'''encode_multipart_formdata taken from @ryanmcgrath `twython`''' | |
def post_image(self): | |
files = [("photo", 'image.jpg', open('/path/to/image.jpg', 'rb').read())] | |
params = { | |
'oauth_version': "1.0", | |
'oauth_nonce': oauth.generate_nonce(), | |
'oauth_timestamp': int(time.time()), | |
'oauth_token': self.oauth_token, |
This file contains 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 to_header(self, realm=''): | |
"""Serialize as a header for an HTTPAuth request.""" | |
oauth_params = ((k, v) for k, v in self.items() | |
if k.startswith('oauth_')) | |
stringy_params = ((k, escape(str(v))) for k, v in oauth_params) | |
abc_params = {} | |
for k, v in stringy_params: | |
if k == 'oauth_body_hash': |
This file contains 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 updateProfileImage(self, filename, version = 1): | |
""" updateProfileImage(filename) | |
Updates the authenticating user's profile image (avatar). | |
Parameters: | |
image - Required. Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. | |
version (number) - Optional. API version to request. Entire Twython class defaults to 1, but you can override on a function-by-function or class basis - (version=2), etc. | |
""" | |
params = { |
This file contains 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 foreach($this->searchResult as $result): ?> | |
<script type="text/javascript"> | |
function initialize() { | |
var myLatlng = new google.maps.LatLng(<?php echo $result['Latitude'];?>,<?php echo $result['Longitude']; ?>); | |
var myOptions = { | |
zoom: 4, | |
center: myLatlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
} |
This file contains 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
<script> | |
var infowindow = null; | |
var markerArray = []; | |
var bounds: new google.maps.LatLngBounds(); | |
var map = new google.maps.Map(document.getElementById("map_canvas"), {zoom: 4,mapTypeId: google.maps.MapTypeId.ROADMAP}); | |
function set_marker(lat, lng){ | |
var position = new google.maps.LatLng(lat, lng); | |
var marker = new google.maps.Marker({map: map, position: position}); |
OlderNewer