Skip to content

Instantly share code, notes, and snippets.

View sumitkharche's full-sized avatar
👩‍💻
Coding

Sumit Kharche sumitkharche

👩‍💻
Coding
View GitHub Profile
@sumitkharche
sumitkharche / StudentDTO.cs
Created January 6, 2020 18:23
StudentDTO class
namespace automapper_sample
{
public class StudentDTO
{
public string Name { get; set; }
public int Age { get; set; }
public string City { get; set; }
}
}
@sumitkharche
sumitkharche / Student.cs
Created January 6, 2020 18:21
Student class
namespace automapper_sample
{
public class Student
{
public string Name { get; set; }
public int Age { get; set; }
public string City { get; set; }
}
}
<!doctype html>
<html>
<head>
<meta charset='utf8'>
<meta name='viewport' content='width=device-width'>
<title>Svelte & Cosmic JS App</title>
<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
@sumitkharche
sumitkharche / TodoItem.svelte
Created July 4, 2019 19:53
TodoItem.svelte
<script>
import { createEventDispatcher } from 'svelte';
export let todo;
const dispatch = createEventDispatcher();
function deleteTodo() {
dispatch('deleteTodo', {
todo: todo
});
}
function toggleComplete() {
@sumitkharche
sumitkharche / App.svelte
Last active July 5, 2019 17:48
App.svelte
<script>
import { onMount } from "svelte";
import axios from "axios";
import config from "./config.js";
import TodoItem from "./TodoItem.svelte";
export let name;
let todo = "";
$: todos = [];
onMount(getTodos());
function getTodos() {
@sumitkharche
sumitkharche / rollup.config.js
Created July 4, 2019 19:27
rollup.config.js
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import replace from 'rollup-plugin-replace';
const production = !process.env.ROLLUP_WATCH;
export default {
export default {
bucket: {
slug: 'COSMIC_BUCKET',
read_key: 'COSMIC_READ_KEY',
write_key: 'COSMIC_WRITE_KEY',
port: 'PORT',
}
}
import React from 'react'
import {withRouteData} from 'react-static'
import Markdown from "react-markdown";
import { Link } from 'components/Router'
export default withRouteData(({post}) => (
<React.Fragment>
<div className="content">
<Link to="/">{'<'} Back</Link>
</div>
import React from 'react'
import {withRouteData} from 'react-static'
import {Link } from '@reach/router'
export default withRouteData(({posts}) =>(
<React.Fragment>
<div className="container">
{posts.map(post => (
<Link key={post._id} to={`/post/${post._id}`} className="card">
<div style={{ paddingRight: "1em" }}>
<Root>
<header className="header">
<h1 className="header-h1">React-Static & Cosmic JS blog</h1>
<nav className="header-nav">
<Link getProps={isActive} className="header-link" to="/">
Home
</Link>
<Link getProps={isActive} className="header-link" to="/about">
About
</Link>