Skip to content

Instantly share code, notes, and snippets.

@SanskarSans
SanskarSans / react-git.csv
Last active June 26, 2021 01:11
As much git analysis as possible
We can't make this file beautiful and searchable because it's too large.
--568dc3532--Thu Jun 17 14:29:30 2021 -0400--Sebastian Markbåge
1 1 fixtures/blocks/src/index.js
2 2 fixtures/concurrent/time-slicing/src/index.js
1 1 fixtures/devtools/scheduling-profiler/app.js
1 1 fixtures/dom/src/__tests__/wrong-act-test.js
0 1 packages/react-dom/index.classic.fb.js
0 1 packages/react-dom/index.js
0 1 packages/react-dom/index.modern.fb.js
--43f4cc160--Thu Jun 17 13:56:18 2021 +0100--Dan Abramov
import React from 'react'
import PropTypes from 'prop-types'
import { Field } from 'formik'
import get from 'lodash/get'
import { TextField, PhoneField, Radio } from 'commons/Forms/Fields'
import { Label } from 'commons/Forms/commons/styled'
import { Row, Col } from 'commons/Grids'
import Button from 'commons/Buttons'
import { ActionBtn } from './styled'
# step 1 - collect our data
data = pd.read_csv("datasets.txt", header=None)
numpy_data = data.values
x = np.append(np.ones((m, 1)), numpy_data[:, 0].reshape(m, 1), axis=1)
y = numpy_data[:, 1].reshape(m, 1)
theta = np.zeros((2, 1))
def gradient_descent(x, y, theta, alpha, iterations):
''' simultaneously update theta0 and theta1 where
theta0 = theta0 - apha * 1/m * (sum of square error) '''
# simplifytour/graphapi/schema.py
import graphene
from simplifytour.graphapi.users.schema import UserMutations, UserQueries
class Query(UserQueries):
node = graphene.Node.Field()
const sessionHandler = session({
secret : 'none',
rolling : true,
resave : true,
saveUninitialized : true
});
app.use(sessionHandler);
class Cycle(models.Model):
STARS = (
(1, 'one'),
(2, 'two'),
(3, 'three'),
(4, 'four'),
(5, 'five'),
)
category = models.ForeignKey(Category, related_name='cycle', on_delete=models.CASCADE)
from __future__ import unicode_literals
from future.builtins import filter, str
from future.utils import native
import os
from io import BytesIO
from zipfile import ZipFile
from jsonfield import JSONField
from urllib.parse import urljoin
from string import punctuation
from collections import OrderedDict
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
FURNITURE_SHOP_NAME = 'furniture'
FURNITURE_SHOP_TAGLINE = ''
FURNITURE_HOMEPAGE = reverse_lazy('promotions:home')
<Container fluid>
<Switch>
<Route path="/" exact component={Dashboard}/>
<Route path="/dashboard" name="Dashboard" component={Dashboard}/>
<Route path="/customer" name="Customer" component={CustomerMain}/>
<Route path="/transaction" component={Transaction} />
<Redirect from="/" to="/dashboard"/>
</Switch>
</Container>
import { compose } from 'redux';
import { connect } from 'react-redux';
import { graphql } from 'react-apollo';
import { Field, reduxForm } from 'redux-form';
import Section from 'app/generics/Section';
import Row from 'app/generics/Form/Row';
import InputFieldWrapper from 'app/generics/Form/InputFieldWrapper';
import TaskQuery from 'app/App/gql/schemas/Tasks/task';
const TaskForm = props => {