Skip to content

Instantly share code, notes, and snippets.

View pranayairan's full-sized avatar

Pranay Airan pranayairan

View GitHub Profile
@pranayairan
pranayairan / BusinessDetailsQuery.graphql
Created August 13, 2017 20:46
GraphQL query to fetch business details from Yelp's GraphQL API.
query BusinessDetails($businessID: String!){
business(id: $businessID) {
id
name
is_claimed
is_closed
url
phone
display_phone
review_count
query SearchYelp($radius: Float!, $latitude: Float!,$longitude: Float!,$offset:Int!,$term:String!) {
search(term: $term,radius: $radius, latitude: $latitude,longitude: $longitude, limit: 20, offset: $offset) {
total
business {
id
name
rating
photos
price
coordinates {
@pranayairan
pranayairan / RxPermission.java
Created August 13, 2017 18:27
Simple code for RXPermission to get location
rxPermissions.request(Manifest.permission.ACCESS_FINE_LOCATION)
.subscribe(new Consumer<Boolean>() {
@Override
public void accept(@NonNull Boolean locationPermissionGranted) throws Exception {
// if location permission is granted query the api
if (locationPermissionGranted) {
} else {
}
@pranayairan
pranayairan / androidShipwithDb.java
Created August 27, 2012 15:26
Code to use existing database in your android app
public class DataBaseHelper extends SQLiteOpenHelper{
//The Android's default system path of your application database.
//replace com.binarybricks.shippingwithsqllite with you Application package nae
//This should be same as which you used package section in your manifest
private static String DB_PATH = "/data/data/com.binarybricks.shippingwithsqllite/databases/";
//replace this with name of your db file which you copied into asset folder
private static String DB_NAME = "dexterology";
@pranayairan
pranayairan / gist:3432212
Created August 23, 2012 04:13
Testing Gist on tumblr
class Voila {
public:
// Voila
static const string VOILA = "Voila";
// will not interfere with embedded tags.
}