Skip to content

Instantly share code, notes, and snippets.

@ergenekonyigit
ergenekonyigit / assigning-properties-in-typescript.ts
Created January 20, 2021 06:57 — forked from gvergnaud/assigning-properties-in-typescript.ts
Assigning properties to an Object type in TypeScript
/**
* # Assigning properties to an object type in TypeScript
*
* When we want to assign some properties on a object type
* we usually use the `&` operator:
*
* type B = A & { someProperty: string }
*
* It seems to work at first sight, but it doesn't behave exactly
* as we would expect when we try to override properties that already
@ergenekonyigit
ergenekonyigit / perf-diagnostics.css
Created January 14, 2021 12:50 — forked from tkadlec/perf-diagnostics.css
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@ergenekonyigit
ergenekonyigit / index.css
Created September 5, 2020 12:36
blurred background
.avatar {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100px;
height: 100px;
border-radius: 10%;
let hooks = [];
let idx = 0;
export function useState(initialState) {
let state = hooks[idx] || initialState;
let _idx = idx;
function setState(newState) {
hooks[_idx] = newState;
render();
<h1>change your color preferences or edit the media query</h1>
:root {
  --prefer-dark: initial;
  
  --light-surface: hsl(0 0% 90%);
 --dark-surface: var(--prefer-dark) hsl(0 0% 10%);
@ergenekonyigit
ergenekonyigit / react.md
Created January 1, 2019 18:37 — forked from lpalmes/react.md
React and Reconcilers in Reason

React

This is the base of all projects and it will include the foundation for all potential react-based projects in Reason.

This base package should include a ReasonReact api to promote collaboration and familiarity with people using a ReasonReact, and for the modern world of React this should also include a Hooks api that currently revery uses.

React module

All blocks in Jsx are of type React.reactElement. This reactElement should represent:

@ergenekonyigit
ergenekonyigit / 1-useState.js
Created October 26, 2018 08:31 — forked from schneidmaster/1-useState.js
React Conf 2018 -- new functional component APIs https://reactjs.org/docs/hooks-intro.html
// Basic example of useState.
import React, { useState } from 'react';
export default function Greeting(props) {
const [name, setName] = useState('Mary');
function handleNameChange(e) {
setName(e.target.value);
}
@ergenekonyigit
ergenekonyigit / ad-manifesto.md
Created October 22, 2018 13:10 — forked from rxwei/ad-manifesto.md
First-Class Automatic Differentiation in Swift: A Manifesto

First-Class Automatic Differentiation in Swift: A Manifesto

This document is written for both the machine learning community and the Swift programming language design community, with a strong focus on language design.

Table of Contents

@ergenekonyigit
ergenekonyigit / cloudSettings
Last active July 18, 2019 12:33
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-07-18T12:33:09.847Z","extensionVersion":"v3.4.0"}