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 / allplugins.php
Last active May 15, 2020 18:46
Git clone all YOURLS plugins
<?php
define('PLUGIN_DIR', str_replace('\\', '/', __DIR__.'/plugins'));
require __DIR__ . '/simplehtmldom/simple_html_dom.php';
/**
* Mirror plugins maintainted via Git on Github or Bitbuckets
*/
$html = file_get_html('https://github.com/YOURLS/YOURLS/wiki/Plugin-List');
foreach($html->find('h4') as $link) {
@ozh
ozh / Facebook-xoxo-Congrats.md
Last active June 22, 2022 16:32
Facebook Congrats & Kisses animations

Hearts & kisses :

  • xo
  • xoxo
  • xoxoxo
  • Besos y abrazos
  • bisou
  • bisous
  • baci
  • 꽁냥꽁냥
@ozh
ozh / plugin.php
Last active October 13, 2022 21:39
YOURLS plugin: keep query string
<?php
/*
Plugin Name: Keep Query String
Description: Adds short URL query string, if any, to the long URL
Version: 0.1
Author: Ozh
*/
yourls_add_filter('redirect_location', 'ozh_kqs');
@ozh
ozh / +imagenumber.js
Created August 9, 2017 10:15
Bookmarklets
javascript:(function(){%20var%20e,s;%20IB=1;%20function%20isDigit(c)%20{%20return%20("0"%20<=%20c%20&&%20c%20<=%20"9")%20}%20L%20=%20location.href;%20LL%20=%20L.length;%20for%20(e=LL-1;%20e>=0;%20--e)%20if%20(isDigit(L.charAt(e)))%20{%20for(s=e-1;%20s>=0;%20--s)%20if%20(!isDigit(L.charAt(s)))%20break;%20break;%20}%20++s;%20if%20(e<0)%20return;%20oldNum%20=%20L.substring(s,e+1);%20newNum%20=%20""%20+%20(parseInt(oldNum,10)%20+%20IB);%20while%20(newNum.length%20<%20oldNum.length)%20newNum%20=%20"0"%20+%20newNum;%20location.href%20=%20L.substring(0,s)%20+%20newNum%20+%20L.slice(e+1);%20})();
@ozh
ozh / typefast.html
Created August 6, 2017 10:32
How Fast Can You Type (simple typing accuracy test I made in 2007)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Typing Speed Test &mdash; How fast can you type ?</title>
<style type="text/css">
#o_keypressed, #o_wordok, #o_wordnotok {zdisplay:none;}
#o_typein{font-size:21px; margin:15px;padding-top:6Opx;display:none;}
body {font:16px Verdana,Arial}
#timer {font-size:30px; color: #494;background:#efe; border:1px solid #cdc; width:100px; height:80px; float:left; margin:0 10px; text-align:center}
@ozh
ozh / wifi_pass.md
Created July 3, 2017 08:01
Retrieve saved WiFi passwords on Windows
> netsh wlan show profiles
> netsh wlan show profile name=<profile> key=clear
@ozh
ozh / 0readme.txt
Last active November 29, 2022 14:41
YOURLS page title test pages
Various files, from actual web sites, mixing different content type as served by the server and as declared by the HTML
@ozh
ozh / unu.sh
Created May 20, 2017 09:54
YOURLS simple bash utility to shorten links
#!/bin/sh
# u.nu's tool: view-source:https://u.nu/public/scripts/unu
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo "usage: unu long_url [custom_keyword]"
echo ""
echo "Shorten URLs with u.nu URL shortener"
echo "This script expects a long URL to shorten either as an argument or passed through STDIN."
@ozh
ozh / cleanup.sh
Last active November 23, 2017 13:25
Clean up your vendor library directories before prod (remove tests, docs...)
#!/bin/bash
####################################################################
# Remove unneeded files for production
#
# Run this script when adding, updating or removing a 3rd party
# library that goes in the `vendor` directory.
#
# Typical use:
#
@ozh
ozh / doctrine_clean.sh
Created May 17, 2017 13:16
Doctrine clean up script
for D in `ls`; do cd $D; rm -rf ".git"; rm -rf "tests"; rm -rf "docs"; rm -rf "bin"; mkdir md_backup; mv README.
md md_backup; rm -f ./{,.[!.],..?}*; mv md_backup/* .; rm -rf md_backup; cd ..; done
# Run in blah/vendor/doctrine, where you have ./annotations, ./dbal, ./common, etc...
# Will delete all .git, tests, docs & bin diretories, and all files subdir root except the readme