type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
if (window.navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(function (position) { | |
var lat = position.coords.latitude, | |
lng = position.coords.longitude, | |
latlng = new google.maps.LatLng(lat, lng), | |
geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({'latLng': latlng}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
if (results[1]) { | |
for (var i = 0; i < results.length; i++) { |
'''Provides utility functions for encoding and decoding linestrings using the | |
Google encoded polyline algorithm. | |
''' | |
def encode_coords(coords): | |
'''Encodes a polyline using Google's polyline algorithm | |
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html | |
for more information. | |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
from random import choice | |
from string import ascii_lowercase, digits | |
from django.contrib.auth.models import User | |
def generate_random_username(length=16, chars=ascii_lowercase+digits, split=4, delimiter='-'): | |
username = ''.join([choice(chars) for i in xrange(length)]) | |
if split: | |
username = delimiter.join([username[start:start+split] for start in range(0, len(username), split)]) |
How to crack Sublime Text (2 and 3) | |
=== | |
1. Open Sublime in a HEX editor (the executable file) | |
2. Find 43 33 33 42 30 32 | |
3. Replace in the string above 33 42 with 32 42 | |
4. Save | |
5. Enter the license below: | |
—–BEGIN LICENSE—– |