Skip to content

Instantly share code, notes, and snippets.

@makestory
makestory / gist:1039648
Created June 22, 2011 07:40
vim function for create xml/html tag.
# useage:
#copy code to your .vimrc
#when you edit text in line > I`m a title
#command :H h1
#<h1>I`m a title</h1>
function! HtmlTag(tag)
normal $
execute "normal! a</".a:tag.'>'
normal ^
@makestory
makestory / geocoding_script
Created November 13, 2010 12:06
a function used to locate lat/lng by address name (google maps api v3)
function initialize() {
map = new google.maps.Map(document.getElementById("your_map_canvas"));
// example => geocoding('China Beijing')
function geocoding(address){
geocoder.geocode( {'address': address }, function(results, status) {
if(status == google.maps.GeocoderStatus.OK){
$.map(results, function(item) {
map.setCenter(new google.maps.LatLng(item.geometry.location.lat(),item.geometry.location.lng()));
map.setZoom(item.address_components.length * 2 + 3);
marker.setPosition(map.getCenter())