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 geocoder = require('geocoder'); | |
| // Geocoding | |
| geocoder.geocode("Atlanta, GA", function ( err, data ) { | |
| // do stuff with data | |
| }); | |
| // Reverse Geocoding | |
| geocoder.reverseGeocode( 33.7489, -84.3789, function ( err, data ) { | |
| // do stuff with data |
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 geocoder = require('geocoder'); | |
| // Geocoding | |
| geocoder.geocode("Atlanta, GA", function ( err, data ) { | |
| // do stuff with data | |
| }); | |
| // Reverse Geocoding | |
| geocoder.reverseGeocode( 33.7489, -84.3789, function ( err, data ) { | |
| // do stuff with data |
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 StreamBuffer(req) { | |
| var self = this | |
| var buffer = [] | |
| var ended = false | |
| var ondata = null | |
| var onend = null | |
| self.ondata = function(f) { | |
| for(var i = 0; i < buffer.length; i++ ) { |
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
| // modules | |
| var redis = require('redis'); | |
| var Step = require('step'); | |
| // config file | |
| var config = require('config'); | |
| // mysql client connect | |
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ |
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
| /** | |
| * | |
| * query_cache | |
| * | |
| * 查询缓存,返回数据集。如果缓存不存在或系统不支持缓存,则直接从model中提取。 | |
| * | |
| * | |
| * @param string $key Key of the cache item | |
| * @param string $model Model name from which we retrieve data | |
| * @param string $method Method name of such model |
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
| # using memcache | |
| memcached -d -m 1024 -l 0.0.0.0 -p 11211 | |
| cached_obj = Memcache.new('localhost:11211', :readonly => true) | |
| cached_obj.request_timeout = 10 | |
| cached_obj = Memcache.new('localhost:11211', "mem2.example.com:11211") | |
| zoo = Memcache.new("localhost:11211") | |
| zoo[:donkeys] = ["siva","siva","siva"*4] |
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
| # fabconf.py | |
| import os | |
| import time | |
| from fabric.api import * | |
| from fabric.contrib import django | |
| django.settings_module('mostlymeta.settings') | |
| from django.conf import settings | |
| env.fab_root = os.path.dirname(__file__) |
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
| <div id="iPhoneBro" class="iPhone gen"> | |
| <div class="title"> | |
| <input type="submit" class="back button" value="Messages"> | |
| <span class="contact_name button">(614) MEME-BRO</span> | |
| <input type="submit" class="edit button" value="Edit"> | |
| </div> | |
| <div id="conversation" class="conversation "> | |
| <div class="time"><div class="time"><p>Aug 9, 2012 3:43 AM</p></div></div><div class="text sent" id="query"><div class="reflect"></div><p>Check Out <a href-"http://www.memebro.com/?r=codepen">memebro.com</a></p></div> | |
| <div class="text receive"><div class="reflect"></div><p>Try "+popular", "+trending", or "+new" for meme lists</p></div> | |
| <div class="text sent" id="query"><div class="reflect"></div><p>+popular</p></div> |
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
| package hardware; | |
| import java.util.ArrayList; | |
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.location.Location; | |
| import android.location.LocationListener; | |
| import android.location.LocationManager; | |
| import android.location.LocationProvider; |
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
| package com.amay077.android.location; | |
| import java.util.Timer; | |
| import java.util.TimerTask; | |
| import android.location.Location; | |
| import android.location.LocationListener; | |
| import android.location.LocationManager; | |
| import android.os.Bundle; |