Skip to content

Instantly share code, notes, and snippets.

View muhammadzaky15's full-sized avatar

muhammad zaky muhammadzaky15

View GitHub Profile
@muhammadzaky15
muhammadzaky15 / tinymce-react-nextjs.md
Created October 18, 2020 14:35 — forked from zhangshine/tinymce-react-nextjs.md
NextJs- React - Self hosted TinyMCE
  1. Install (TinyMCE 5.x)
npm install --save tinymce @tinymce/tinymce-react copy-webpack-plugin
  1. Copy static files(tinymce skins) to public folder. Edit file next.config.js
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
@muhammadzaky15
muhammadzaky15 / nearby-coordinates.sql
Created September 13, 2019 07:45 — forked from statickidz/nearby-coordinates.sql
Ordering with SQL by nearest latitude & longitude coordinates (MySQL & SQLite)
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC