Skip to content

Instantly share code, notes, and snippets.

🐢
Focusing

Tarang Hirani tarang9211

🐢
Focusing
View GitHub Profile
@tarang9211
tarang9211 / questions.js
Created Sep 10, 2018
Data for input fields
View questions.js
const questions = [
{
id: 0,
question: "What is your name?",
value: ""
},
{
id: 1,
question: "What is your dog's name?",
value: ""
View app.js
import React, { Component } from 'react';
class App extends Component {
state = {
questions: this.props.questions,
showState: false,
};
handleChange = id => e => {
View app-partial.js
import React, { Component } from 'react';
class App extends Component {
render() {
return (
<div className='App'>
<form>
<button type="submit">Submit</button>
</form>
View dynamic_input_2.1.js
import React, { Component } from 'react';
class App extends Component {
state = {
inputs: [],
showState: false
};
handleSubmit = (event) => {
event.preventDefault();
View dynamic_input_2.2.js
import React, { Component } from 'react';
class App extends Component {
state = {
inputs: [],
showState: false
};
handleSubmit = (event) => {
event.preventDefault();
View List.js
import React, { Component } from 'react';
import styles from './step-list.module.scss';
class StepList extends Component {
steps = [
{ key: 0, title: 'Overview' },
{ key: 1, title: 'Dates' },
{ key: 2, title: 'Add Seminars' },
{ key: 3, title: 'Upload an image' },
{ key: 4, title: 'Preview' }
View mongo.js
import { ApolloError } from 'apollo-server';
import jwt from 'jsonwebtoken';
import ConferenceModel from '../models/conference';
import SubeventModel from '../models/subevent';
import uploadImage from '../utils/image-upload';
export default {
Mutation: {
async createConference(roots, args, context) {
const { token } = context;
View count.js
/** Fetch all conferences */
let selectConferencesQuery;
try {
selectConferencesQuery = await query(
'SELECT id, name, description, dates, tags, image FROM conferences'
);
} catch (e) {}
/** Fetch the count of subevents related to a conference */
const conferenceIds = selectConferencesQuery.results.map(
View query.js
import React from 'react';
import { Navbar } from 'shared/components';
import { Query } from 'react-apollo';
import gql from 'graphql-tag';
const Home = () => {
return (
<>
<Navbar isAuthenticated={true} />
<div className="container">
@tarang9211
tarang9211 / CurvedUIView.swift
Created May 28, 2019 — forked from anitaa1990/CurvedUIView.swift
A Swift extension of UIView to display a curved view
View CurvedUIView.swift
import UIKit
extension UIView {
/* Usage Example
* bgView.addBottomRoundedEdge(desiredCurve: 1.5)
*/
func addBottomRoundedEdge(desiredCurve: CGFloat?) {
You can’t perform that action at this time.