Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hassan Abid hassanabidpk

🎯
Focusing
Block or report user

Report or block hassanabidpk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hassanabidpk
hassanabidpk / home.js
Created Aug 18, 2017
Pycon Lunch React Native Home Screen
View home.js
import React from 'react';
import { StyleSheet, Text, FlatList, ActivityIndicator, View, Image } from 'react-native';
import { List, ListItem, SearchBar, Avatar } from "react-native-elements";
import { StackNavigator } from 'react-navigation';
export default class HomeScreen extends React.Component {
constructor(props) {
super(props);
this.state = {
@hassanabidpk
hassanabidpk / App.js
Created Aug 18, 2017
Pycon Lunch React Native
View App.js
// @flow
import React from 'react';
import { StyleSheet, Text, FlatList, ActivityIndicator, View, Image } from 'react-native';
import { List, ListItem, SearchBar, Avatar } from "react-native-elements";
import { StackNavigator } from 'react-navigation';
import { constants } from 'expo';
import HomeScreen from './src/components/home';
import DetailScreen from './src/components/detail';
@hassanabidpk
hassanabidpk / sample.json
Created Aug 18, 2017
Pycon Lunch sample response
View sample.json
[{
"id": 3,
"name": "Newyork Pizza",
"address": "Coex mall west gate, first floor, Seoul",
"photo": "/media/food/photos/piza.jpg",
"tags": "pizza",
"menu": "1. Cheese pizza\r\n2. Vegetable Pizza\r\n3. Chicken Pizza",
"pub_date": "2017-08-05T16:34:08.094007Z"
}]
@hassanabidpk
hassanabidpk / views.py
Created Aug 18, 2017
Pycon Lunch Views
View views.py
from django.shortcuts import render
from django.http import JsonResponse
from .models import Restaurant
from .serializers import RestaurantSerializer
from django.views.decorators.csrf import csrf_exempt
def index(request):
rest_list = Restaurant.objects.order_by('-pub_date')
context = {'rest_list': rest_list}
@hassanabidpk
hassanabidpk / serializers.py
Created Aug 18, 2017
Pycon Lunch serializer
View serializers.py
from rest_framework import serializers
from food.models import Restaurant
class RestaurantSerializer(serializers.ModelSerializer):
class Meta:
model = Restaurant
fields = ('id', 'name', 'address', 'photo', 'tags', 'menu', 'pub_date')
@hassanabidpk
hassanabidpk / models.py
Created Aug 18, 2017
Pycon Lunch Model
View models.py
from django.db import models
from django.contrib.auth.models import User
class Restaurant(models.Model):
name = models.CharField(max_length=200)
address = models.TextField()
photo = models.ImageField(upload_to="food/photos/", null=True, blank=True)
menu = models.TextField()
tags = models.CharField(max_length=200)
View RestaurantListActivity.java
private void initiateRestaurantApi(String place, String query,final View recyclerView) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(API_BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
SearchRestaurantApi api = retrofit.create(SearchRestaurantApi.class);
Call<SearchRestaurantResponse[]> call = api.getRestaurantsList("json",place,query);
progessBar.setVisibility(View.VISIBLE);
call.enqueue(new Callback<SearchRestaurantResponse[]>() {
View SearchRestaurantResponse.java
package co.searchrestaurant.android.app.fetch;
import java.util.List;
/**
* Created by hassanabid on 2/27/16.
*/
public class SearchRestaurantResponse {
public String status;
View SearchRestaurantApi.java
package co.searchrestaurant.android.app.fetch;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
/**
* Created by hassanabid on 2/27/16.
*/
public interface SearchRestaurantApi {
View soom_helpers.md

Remove existing version sudo apt-get -y remove nodejs*

Install new version curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

Install Bluetooth modules

sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev

You can’t perform that action at this time.