Skip to content

Instantly share code, notes, and snippets.

View solofeed's full-sized avatar
🦁
Working from home

Eugene (Yevhenii) Kuzmenko solofeed

🦁
Working from home
View GitHub Profile
@dankremniov
dankremniov / Chart.tsx
Last active February 21, 2024 06:41
Render React component for Highcharts tooltip
import React, { useState, useCallback } from "react";
import Highcharts, { Chart as HighchartsChart } from "highcharts";
import HighchartsReact from "highcharts-react-official";
import { Tooltip } from "./Tooltip";
const options = {
title: {
text: "Custom tooltip as React component"
},
series: [
@PierfrancescoSoffritti
PierfrancescoSoffritti / eventBus.js
Last active February 15, 2024 14:16
A simple implementation of an event bus in Javascript. More details here: https://medium.com/@soffritti.pierfrancesco/create-a-simple-event-bus-in-javascript-8aa0370b3969
/**
* subscriptions data format:
* { eventType: { id: callback } }
*/
const subscriptions = { }
const getNextUniqueId = getIdGenerator()
function subscribe(eventType, callback) {
const id = getNextUniqueId()
@taufek
taufek / pre-push
Last active January 10, 2023 17:40
PrePush Git Hook with PhpCs and PhpStan
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
exec < /dev/tty
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE