Skip to content

Instantly share code, notes, and snippets.

View djirdehh's full-sized avatar
🏃‍♂️
runnin through the six

Hassan Djirdeh djirdehh

🏃‍♂️
runnin through the six
View GitHub Profile
import { useActionState } from "react";
const addTodo = async (todoDetails) => {
const response = await fetch("https://dummyjson.com/todos/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(todoDetails),
});
return response.json();
};
@djirdehh
djirdehh / Form.js
Created March 9, 2023 00:43
Code example used for the KendoReact article: React Basics: React Forms Examples
import React, { useState } from 'react';
export function Form() {
const [formData, setFormData] = useState({
username: '',
password: '',
errors: [],
loading: false,
});
@djirdehh
djirdehh / index.js
Created March 3, 2023 02:10
Index file of code samples used in the following article: An Introduction to the KendoReact Card Component
import React from "react";
import ReactDOM from "react-dom/client";
import { Skeleton } from "@progress/kendo-react-indicators";
import {
Avatar,
Card,
CardTitle,
CardSubtitle,
CardHeader,
CardImage,
@djirdehh
djirdehh / index.js
Created January 26, 2023 01:26
Index file of code sample used in the following article: Building loading screens with KendoReact’s Skeleton component
import React from "react";
import ReactDOM from "react-dom/client";
import { Skeleton } from "@progress/kendo-react-indicators";
import {
Avatar,
Card,
CardTitle,
CardSubtitle,
CardHeader,
CardImage,
@djirdehh
djirdehh / index.js
Created January 15, 2023 18:06
Example of sorting and row selecting with React Table
import React from "react";
import { useTable, useSortBy, useRowSelect } from "react-table";
function App() {
const columns = React.useMemo(
() => [
{
Header: "Name",
accessor: "name"
},
@djirdehh
djirdehh / index.js
Last active January 1, 2023 17:56
Index file of code sample used in the following article: An introduction to the KendoReact Map component
import React from "react";
import ReactDOM from "react-dom/client";
import {
Map,
MapLayers,
MapTileLayer,
MapMarkerLayer,
MapBubbleLayer,
} from "@progress/kendo-react-map";
import "./index.scss";
// ==UserScript==
// @name Override Instacart Ads Manager flippers
// @namespace https://ads.instacart.com/
// @version 0.6
// @updateURL https://gist.githubusercontent.com/jiang925/94b31524a7f38d32000c20797f1d53db/raw/override-flippers.user.js
// @downloadURL https://gist.githubusercontent.com/jiang925/94b31524a7f38d32000c20797f1d53db/raw/override-flippers.user.js
// @description Override Instacart Ads Manager flippers from UI. Note that this only affects pure UI flippers. This does not affects the flippers on the backend.
// @author Tian Jiang
// @include *://*.instacart.com/*
// @include *://*-web-ads-stg.instacart.team/*
import { createApp } from "vue";
import App from "./App.vue";
import store from "./store";
createApp(App).use(store).mount("#app");
@djirdehh
djirdehh / store.js
Last active January 23, 2021 23:41
import { createStore } from "vuex";
export default createStore({
state
mutations
actions
getters
});
import { reactive } from "vue";
export const store = {
state: reactive({
numbers: [1, 2, 3]
}),
addNumber(newNumber) {
this.state.numbers.push(newNumber);
}
};