Skip to content

Instantly share code, notes, and snippets.

Avatar
🏃‍♂️
runnin through the six

Hassan Djirdeh djirdehh

🏃‍♂️
runnin through the six
View GitHub Profile
@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
View index.js
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
View index.js
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
View index.js
import React from "react";
import ReactDOM from "react-dom/client";
import {
Map,
MapLayers,
MapTileLayer,
MapMarkerLayer,
MapBubbleLayer,
} from "@progress/kendo-react-map";
import "./index.scss";
View new-nav-override-flipper.js
// ==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/*
View main.js
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
View store.js
import { createStore } from "vuex";
export default createStore({
state
mutations
actions
getters
});
View store.js
import { reactive } from "vue";
export const store = {
state: reactive({
numbers: [1, 2, 3]
}),
addNumber(newNumber) {
this.state.numbers.push(newNumber);
}
};
View NumberDisplay.vue
<template>
<div>
<h2>{{ numbers }}</h2>
</div>
</template>
<script>
import { emitter } from "../event-bus.js";
export default {
name: "NumberDisplay",
View NumberSubmit.vue
<template>
<div>
<input v-model="number" type="number" />
<button @click="addNumber">Add new number</button>
</div>
</template>
<script>
import { emitter } from "../event-bus.js";
export default {
@djirdehh
djirdehh / event-bus.js
Created January 23, 2021 23:24
Event Bus Emitter
View event-bus.js
import mitt from "mitt";
export const emitter = mitt();