Skip to content

Instantly share code, notes, and snippets.

@Scanerrr
Scanerrr / wp change links
Created August 30, 2017 18:50
Change wordpress links in DB
@Scanerrr
Scanerrr / cloudSettings
Last active October 14, 2019 20:43
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-14T20:43:44.571Z","extensionVersion":"v3.4.3"}
@Scanerrr
Scanerrr / image-preview.js
Last active September 25, 2018 09:22
Load image preview from file input
function readURL(input) {
const file = input.files
const img = document.querySelector('.image-preview img')
if (!file || !file[0]) return img.src = '';
img.src = URL.createObjectURL(file[0])
}
.loader-wrapper {
position: fixed;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
@Scanerrr
Scanerrr / .htaccess
Last active April 2, 2020 08:33
SVG map with cities and changing subdomains
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#if not already blog.website.com
#RewriteCond %{HTTP_HOST} !^odessa\.example\.ua [NC]
#if request is for blog/, go to blog.website.com
RewriteRule ^odessa/?(.*)$ https://odessa.example.ua/$1 [L,NC,R=301]
RewriteRule ^ru/odessa/?(.*)$ https://odessa.example.ua/ru/$1 [L,NC,R=301]
@Scanerrr
Scanerrr / AppleMap.jsx
Last active June 15, 2022 17:04
Apple mapkitJS places example
import { useCallback, useState } from "react";
import { useMap } from "./useMap";
import { useSearch } from "./useSearch";
export default function AppleMap() {
const { mapkit, map, mapRef } = useMap();
const search = useSearch();
const [value, setValue] = useState("");
const [adressesList, setAddressesList] = useState(null);