Skip to content

Instantly share code, notes, and snippets.

View emseidov's full-sized avatar

Emrah Seidov emseidov

View GitHub Profile
import React from 'react';
import ReactDOM from 'react-dom';
import _ from 'lodash';
import shortid from 'shortid';
const App = () => {
const experiment = n => console.log(n);
return (
<h1>
@emseidov
emseidov / laser-wave-adjustments.js
Created May 10, 2020 03:25
LaserWave adjustments.json
"editor.tokenColorCustomizations": {
"[LaserWave Italic]": {
"textMateRules": [
{
"scope": [
"comment.block",
"comment.line.double-slash.js.jsx",
"comment.line"
],
"settings": {
[test]: Update test/* files
[dist]: Changes to submodules, version bumps, updates to package.json
[minor]: Small changes
[doc]: Updates to documentation
[fix]: Bug fixes
[bin]: Update binary scripts associated with the project
[refactor]: Refactor of existing code
[nit]: Small code review changes mainly around style or syntax
[feat]: New features
import React from 'react';
export default function useCounter() {
const [count, setCount] = React.useCounter(0);
function increment() {
setCount(count + 1);
}
function decrement() {
import { useCounter } from '../hooks';
export default function CounterWithHooks({ count, increment, decrement }) {
return (
<>
<p>Count: {count}</p>
<button type="button" onClick={increment} />
<button type="button" onClick={decrement} />
</>
)
import React from "react";
export default function withCounter(Component) {
return class extends React.Component {
constructor() {
super();
this.state = {
count: 0,
};
import { withCounter } from '../hoc';
function ComponentNeeedingCounterFunctionality({ count, increment, decrement }) {
return (
<>
<p>Count: {count}</p>
<button type="button" onClick={increment}>Increment</button>
<button type="button" onClick={decrement}>Decrement</button>
</>
);
import React from 'react';
export default class Counter extends React.Component {
constructor() {
this.state = {
count: 0
}
this.increment = this.increment.bind(this);
this.decrement = this.decrement.bind(this);
(() => {
// Constants
const MUTATION_TYPE = {
attributes: 'attributes'
};
const OBSERVER_CONFIG = {
attributes: true
};
const MOUSE_EVENT_CONFIG = {
view: window,
@emseidov
emseidov / main.cpp
Last active December 2, 2021 17:38
Dzhuneyt course assignment
/**
* Даден е двумерен масив A с m реда n стълба. Да се се състави
* блоксхема на алгоритъм, чрез който се създава нов масив b1, b2, ..., bm
* като стойността на bi е равна на средното аритметично на ненулевите
* елементи в i-ия ред. Да се състави програма по този алгоритъм.
*/
#include<iostream>
#include<stdlib.h>
using namespace std;