Skip to content

Instantly share code, notes, and snippets.

Avatar
🐕
Chillin

Uddeshya Singh uds5501

🐕
Chillin
View GitHub Profile
@uds5501
uds5501 / themepart3.js
Created May 6, 2020
adding new colours in the mix
View themepart3.js
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
import React, { useState } from "react";
import Switch from "@material-ui/core/Switch";
export default function Dashboard() {
const [darkState, setDarkState] = useState(false);
const palletType = darkState ? "dark" : "light";
const mainPrimaryColor = darkState ? orange[500] : lightBlue[500];
const mainSecondaryColor = darkState ? deepOrange[900] : deepPurple[500];
const darkTheme = createMuiTheme({
@uds5501
uds5501 / themestep2.js
Last active May 6, 2020
Theme switcher
View themestep2.js
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
import React, { useState } from "react";
import Switch from "@material-ui/core/Switch";
export default function Dashboard() {
const [darkState, setDarkState] = useState(false);
const palletType = darkState ? "dark" : "light";
const darkTheme = createMuiTheme({
palette: {
type: palletType,
View themestep1.js
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
import React, { useState } from "react";
export default function Dashboard() {
const [darkState, setDarkState] = useState(false);
const palletType = darkState ? "dark" : "light";
const darkTheme = createMuiTheme({
palette: {
type: palletType,
}
@uds5501
uds5501 / theme_pallet.js
Last active May 6, 2020
step 1 of dark theme
View theme_pallet.js
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
import React, { useState } from "react";
export default function Dashboard() {
const [darkState, setDarkState] = useState(false);
const palletType = darkState ? "dark" : "light";
const darkTheme = createMuiTheme({
palette: {
type: palletType,
}
@uds5501
uds5501 / GSoC19-work-product.md
Last active Sep 11, 2021
GSoC 2019 Work Product | Uddeshya Singh | Open Event Frontend & Server | FOSSASIA
View GSoC19-work-product.md

Uddeshya Singh | @uds5501 | FOSSASIA

Overview:

In this summer period, I worked on FOSSASIA's Open Event projects (comprising of Open Event Server and Open Event Frontend). The Open Event , popularly know as Eventyay, is an open sourced event management platform which enables users to host conferences and various kinds of meet-ups and helps them customize their event according to their requirements. Sophisticated features like tickets, payment collections and call for speakers have been provided and can be further fine tuned into several tracks, venues and sessions.

My main goal of this period was to focus on making the Eventyay platform more stable for new users while laying down foundations for making the platform smoother in terms of payment gateway integrations and payment workflows.

@uds5501
uds5501 / apipermit.py
Last active Apr 25, 2019
api.haspermit decorator
View apipermit.py
from flask import Flask
from flask_rest_jsonapi import Api
from your_project.permission import permission_manager
app = Flask(__name__)
api = Api()
api.init_app(app)
api.permission_manager(permission_manager)
View tax_api.py
from flask import request
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
from flask_rest_jsonapi.exceptions import ObjectNotFound
from sqlalchemy.orm.exc import NoResultFound
from app.api.bootstrap import api
from app.api.helpers.db import get_count, safe_query
from app.api.helpers.exceptions import ForbiddenException, ConflictException, MethodNotAllowed
from app.api.helpers.permission_manager import has_access
from app.api.helpers.utilities import require_relationship
View schema_tax.py
from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Relationship
from app.api.helpers.utilities import dasherize
from app.api.schema.base import SoftDeletionSchema
from utils.common import use_defaults
@use_defaults()
class TaxSchemaPublic(SoftDeletionSchema):
@uds5501
uds5501 / model.py
Created Aug 27, 2018
for fashion mnist blog
View model.py
model = Sequential()
# Tier one
model.add(Conv2D(32, kernel_size=5, input_shape = (28, 28, 1), activation='relu', padding = 'Same' ))
model.add(Conv2D(64, kernel_size=5, activation='relu'))
model.add(BatchNormalization())
model.add(MaxPooling2D(pool_size = (2, 2)))
model.add(Dropout(0.33))
model.add(Conv2D(128, kernel_size=3, activation='relu'))
model.add(Conv2D(256, kernel_size=3, activation = 'relu'))
View decisionTreeClassifier.py
from sklearn.tree import DecisionTreeClassifier
myClassifier2 = DecisionTreeClassifier(max_depth = 5, min_samples_leaf = 2)
myClassifier2.fit(X_train, y_train)
predictions2 = myClassifier2.predict(X_test)
cnf2 = confusion_matrix(y_test, predictions2)
score2 = accuracy_score(y_test, predictions2)
print ("Confusion Matrix for our Decision Tree classifier is :\n ", cnf2)