Skip to content

Instantly share code, notes, and snippets.

Avatar
🍷
More wine, please.

྅༻ Ǭɀħ ༄༆ཉ ozh

🍷
More wine, please.
View GitHub Profile
@ozh
ozh / bookmarklet.md
Last active Jul 24, 2020
Torrent hash to magnet link bookmarklet
View bookmarklet.md

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

@ozh
ozh / import.md
Created May 22, 2020
import DB with MySQL in XAMP
View import.md
  • 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 May 24, 2020
push on someone's pull request
View push_on_someone_pull_request.md

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
Image border in markdown
View markdown_image_border.md

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"/>

View yourls_kses_extra.php
<?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 May 9, 2020 — forked from davisford/gist:5039064
git clone into non-empty directory
View git-clone-into-not-empty-dir.md

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 Apr 19, 2020
YOURLS article about
View article.md

little known features

  • custom favicon in /user
  • pages
  • maintenance page

plugin of the week

@ozh
ozh / README.md
Created Apr 16, 2020
YOURLS: Old Pages (backward compatibility plugin for pages directory in root)
View README.md

Plugin for YOURLS 1.7.7+: Old Pages

What for

Display pages that are located in <root>/pages/ instead of <root>/user/pages/

How to

  • In /user/plugins, create a new folder named old-pages
  • Drop these files in that directory
@ozh
ozh / notepad++plugins.md
Created Apr 14, 2020
Notepad++ plugins
View notepad++plugins.md
You can’t perform that action at this time.