Skip to content

Instantly share code, notes, and snippets.

View ozh's full-sized avatar
🍷
More wine, please.

྅༻ Ǭɀħ ༄༆ཉ ozh

🍷
More wine, please.
View GitHub Profile
@ozh
ozh / readme.md
Created February 20, 2021 13:38
XAMPP PHP 7.4 and PHP 8

Step 1: install XAMPP 7.4.1, make it work :) At this point you have C:/yourdir/xampp and in particular C:/yourdir/xampp/php and C:/yourdir/xampp/apache/conf/extra

Step 2 : download XAMPP 8.0.1, as a zip archive, not a self executable install Don't install it. Instead,

  • extract the content of the xampp/php directory and put it in C:/yourdir/xampp/php8
  • extract the file xampp/apache/conf/extra/httpd-xampp.conf and copy it to C:/yourdir/xampp/php and C:/yourdir/xampp/apache/conf/extra/httpd-xampp8.conf

Step 3 : edit C:/yourdir/xampp/php8/php.ini and modify the paths (eg replace all default \xampp with \yourdir\xampp).

@ozh
ozh / bk.md
Last active June 8, 2021 13:42
email + website @ gmail.com bookmarklet

Will populate active input field with "turlututu+<domain name>@gmail.com"

Code:

javascript:(function()%7Bvar%20w%20%3D%20window.location.hostname.replace(%2F%5Ewww%5C.%2F%2C%20'')%3Bw%20%3D%20w.replace(%2F%5C..%7B2%2C3%7D%24%2F%2C%20'').replace(%2F%5E.%2B%5C.%2F%2C%20'')%3Bvar%20i%20%3D%20document.activeElement%3Bif%20(i.tagName%20%3D%3D%20%22INPUT%22%20%7C%7C%20i.tagName%20%3D%3D%20%22TEXTAREA%22)%20%7Bi.value%20%3D%20'turlututu%2B'%20%2B%20w%20%2B%20'%40gmail.com'%3B%7D%7D)()

Expanded:

@ozh
ozh / omgtorrent.cz.md
Last active March 11, 2024 18:36
Torrent hash to magnet link bookmarklet

1) Bookmark this:

javascript:var magnetLink='magnet:?xt=urn:btih:'+document.getSelection();location.assign(magnetLink);

Highlight any torrent hash and click bookmarklet to generate and load magnet link

2) Bookmark this:

@ozh
ozh / import.md
Created May 22, 2020 12:09
import DB with MySQL in XAMP
  • create DB (eg yourls_ozhin)
  • in CMD.exe (not the bash shell) :
d:\online\xampp7\mysql\bin\mysql.exe -u root -p yourls_ozhin < path/to/ozh_ozhin.sql
@ozh
ozh / push_on_someone_pull_request.md
Last active February 12, 2023 11:00
push on someone's pull request

Pull request from THEM to my REPO :

$ git checkout -b THEM-patch-1 master
$ git pull https://github.com/THEM/REPO.git patch-1
$ git commit --allow-empty -m "Trigger build"
$ git push https://github.com/THEM/REPO.git THEM-patch-1:patch-1
@ozh
ozh / markdown_image_border.md
Created May 14, 2020 16:30
Image border in markdown

Image in markdown: no style possible

![alt-text](https://raw.githubusercontent.com/YOURLS/YOURLS/1.7.9/images/yourls-logo.png)

alt-text

IMG tag accepts no style

<img src="https://raw.githubusercontent.com/YOURLS/YOURLS/1.7.9/images/yourls-logo.png" border="1px solid red"/>

<?php
/**
* YOURLS modification of a other functions from WordPress' KSES implementation.
* Not used in core, provided if any plugin or future feature needs anything from here
*
* NOTE: NOT TESTED. MAY OR MAY NOT PRODUCE EXPECTED RESULTS. SOME FUNCTIONS
* MAY BE STILL TIED TO WORDPRESS.
*
* NOTE: THIS FILE IS NOT INCLUDED BY DEFAULT. MANUALLY INCLUDE IT IF NEEDED.
*
@ozh
ozh / git-clone-into-not-empty-dir.md
Last active September 7, 2021 13:56 — forked from davisford/gist:5039064
git clone into non-empty directory

You have a folder with files

$ mkdir -p ~/foo && cd ~/foo
$ touch NEWFILE

You cannot git clone into it because the directory is not empty. To do so:

@ozh
ozh / article.md
Created April 19, 2020 09:23
YOURLS article about

little known features

  • custom favicon in /user
  • pages
  • maintenance page

plugin of the week