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 / gist:5439013
Created April 22, 2013 22:10
Crontab template
MAILTO=""
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
@ozh
ozh / gist:4131243
Created November 22, 2012 13:44
Create dot files/directories (ie .file) on Windows

#How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

@ozh
ozh / composer-proxy.md
Created March 24, 2014 23:30
Using Composer behind a proxy

Define the proxy in the CLI :

$ export https_proxy='87.248.188.202:8080'
$ export http_proxy='87.248.188.202:8080'

Check proxy :

@ozh
ozh / current_result.md
Created March 11, 2022 18:39
Future unit tests for `yourls_is_shorturl()`

As of writing and with YOURLS 1.8.3-dev, expectedly works with http(s)://sho.rt/ozh but fail with http(s)://www.sho.rt/ozh (and logically if YOURLS_SITE has www. (eg http://www.sho.rt) the failures and success get inverted)

$ phpunit --filter ShortURL_Is_Shorturl_Tests
YOURLS installed, starting PHPUnit

PHPUnit 8.5.14 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.0.1 with Xdebug 3.0.2
Configuration: D:\home\planetozh\ozh.in\phpunit.xml
@ozh
ozh / YOURLS_locales.md
Created April 2, 2022 20:36
YOURLS_LANG in the wild

Here are the values of YOURLS_LANG people use in their YOURLS config.php (real life data fetch on April 2022)

Locale
af_ZA
ar
ar-SA
ar_AR
ar_EG
@ozh
ozh / README.md
Created April 19, 2022 15:31
YOURLS Cherokee
@ozh
ozh / index.html
Created March 18, 2023 15:27
Center div in body
<html>
<style>
html {
background-color:yellow;
}
body {
margin:0;
display:grid;
place-items:center;
@ozh
ozh / Blacklisted_MusicTitles
Created March 11, 2023 15:02 — forked from kylecreate/Blacklisted_MusicTitles
Blacklist for DynoBOT | When downloading turn the files into notepad text files | Blacklisted name stuff soonTM | Website: https://www.dynobot.net/ | Invite: https://discordapp.com/invite/9W6EG56
anal, beaner, butt-pirate, buttpirate, butt pirate, chode, clit, cock, cuck, cum , cunt, dike, dyke, douche, feget, fag, fudgepacker, fudge packer, gooch, jigaboo, jungle bunny, junglebunny, kike, kooch, kyke, mcfag, nigg, niga, paki, pollock, poon, porch monkey, porchmonkey, queef, queer, rape, rimjob, rim job, ruski, slut, spic, spick, wetback, wet back, hitler, autist, cuck, douche, memes, dank, keemstar. memestar, dramaalert, gaywards, trapbar, isis, sex offender, nazi, distorted, dat boi, tank, harambe, idubbz, spooky scary, chum drum, swamp, shrek, vape nation, porn, pirate, mr krabs, vocaloid, frozen parody, fuck my ass, i'm a hoe, im a hoe, f*ck my a$$, sjw, social justice warrior, 4chan, 9gag, buzzfeed, smash mouth, spiderman & frozen, frozen elsa and spiderman, spiderman and frozen, frozen elsa & spiderman, pussy, smelly poop fart, toy monster, webs & tiaras, allahu akbar, akbar, allahu, taliban, terriorist
@ozh
ozh / gist:8169202
Created December 29, 2013 10:40
Human readable time difference between 2 dates in PHP
<?php
/**
* Get human readable time difference between 2 dates
*
* Return difference between 2 dates in year, month, hour, minute or second
* The $precision caps the number of time units used: for instance if
* $time1 - $time2 = 3 days, 4 hours, 12 minutes, 5 seconds
* - with precision = 1 : 3 days
* - with precision = 2 : 3 days, 4 hours
@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