Skip to content

Instantly share code, notes, and snippets.

View ghoshabhi's full-sized avatar
🐢
slow and steady

Abhishek Ghosh ghoshabhi

🐢
slow and steady
View GitHub Profile
export const fetchByPostId = id => {
const data = API.getPostById(id);
return {
type: FETCH_POST_BY_ID,
payload: data,
}
}
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import PropTypes from 'prop-types';
import * as FilterListActions from './actions';
import FilterList from '../../components/FiltersList';
class FilterListContainer extends Component {
constructor(props) {
super(props);
import React from 'react';
import PropTypes from 'prop-types';
import GoogleMap from 'google-map-react';
import Section from 'grommet/components/Section';
const Map = ({ center, zoom, onBoundsChange, onMapLoaded }) => (
<Section pad="none" style={{ height: '500px' }}>
<GoogleMap
center={center}
zoom={zoom}
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import PropTypes from 'prop-types';
import Section from 'grommet/components/Section';
import Map from '../../components/Map';
import * as MapActionCreators from './actions';
// import icons from '../../assets/icons-util';
import { find, near } from '../FilterContainer/utils';
import * as types from './constants';
import { find, near } from './utils';
export const initialState = {
selectedFilters: [],
find,
near,
};
const filterListReducer = (state = initialState, action) => {
import * as types from './constants';
export const setUserFilter = filterName => ({
type: types.SET_USER_FILTER,
payload: filterName,
});
export const removeUserFilter = filterName => ({
type: types.REMOVE_USER_FILTER,
payload: filterName,
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import PropTypes from 'prop-types';
import * as FilterListActions from './actions';
import FilterList from '../../components/FiltersList';
class FilterListContainer extends Component {
constructor(props) {
super(props);

Keybase proof

I hereby claim:

  • I am ghoshabhi on github.
  • I am ghoshabhi (https://keybase.io/ghoshabhi) on keybase.
  • I have a public key whose fingerprint is B7ED D3CC 306A 031F C5A3 B1A9 7810 3277 5C74 9BF4

To claim this, I am signing this object:

@ghoshabhi
ghoshabhi / api.py
Created February 20, 2017 18:09
Flask App to authenticate user with Github API. The API is setup to use any front-end technology like React, Vue, etc. The code uses Web Application flow to authenticate users.
#!/usr/bin/env python
from flask import Flask, jsonify, redirect, \
render_template, url_for
from flask import session as login_session
from flask_cors import CORS, cross_origin # My front end is with React and works on a different server
import requests
import random
import string
from credentials import client_id, client_secret # credentials.py has the client_id and client_secret
def sampleJoin():
posts = Post.query(Post.is_draft == False).order(-Post.created)
all_users = User.query()
list_dict = []
for p in posts:
p_dict = {}
for u in all_users:
if p.user == u.key: