Skip to content

Instantly share code, notes, and snippets.

😎
More wine, please.

྅༻ Ǭɀħ ༄༆ཉ ozh

😎
More wine, please.
Block or report user

Report or block ozh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ozh
ozh / cookie.txt
Last active Dec 11, 2017
Cookie Clicker save file
View cookie.txt
@ozh
ozh / Init.php
Created Oct 8, 2017
Alternate bootstrap config class
View Init.php
<?php
/**
* YOURLS actions upon instantiating
*/
namespace YOURLS\Config;
class Init {
@ozh
ozh / funcdefined.php
Last active Sep 7, 2017
PHP : check where a function is defined
View funcdefined.php
<?php
$reflFunc = new ReflectionFunction('function_name');
print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();
// eg /home/you/includes/file.php:60
@ozh
ozh / plugin.php
Created Sep 1, 2017
YOURLS Plugin: delete all URLs
View plugin.php
<?php
/*
Plugin Name: RESET URLS
Plugin URI: http://yourls.org/
Description: OMG
Version: 1.0
Author: Ozh
Author URI: http://ozh.org/
*/
@ozh
ozh / yourls-propel.php
Last active Sep 6, 2017
Propel example with YOURLS
View yourls-propel.php
<?php
/* For the record: I played with Propel2 ORM and checked how I could use it with YOURLS.
*
* Setting up isn't complicated:
* - install Propel with composer
* - `vendor/bin/propel init` and answer quetions to generate the schema.xml, config file and mapped classes,
* based on an existing DB
*
* Using isn't very complicated, but there are quite many functions to tame.
@ozh
ozh / enable-query-log.php
Last active Aug 20, 2017
Enable query log in YOURLS
View enable-query-log.php
<?php
// Needs YOURLS 1.7.3+ with PDO/AuraSQL
$sql = "SET GLOBAL log_output = 'FILE';";
$ydb->exec($sql);
$sql = "SET GLOBAL general_log_file = '/path/to/logfile.log';";
$ydb->exec($sql);
$sql = "SET GLOBAL general_log = 'ON';";
$ydb->exec($sql);
@ozh
ozh / aura-fetch.php
Last active Aug 20, 2017
Aura.sql fetch* methods and their outputs
View aura-fetch.php
<?php
/**
* Table is :
* +-----------+-------------+--------------+
* | option_id | option_name | option_value |
* +-----------+-------------+--------------+
* | 1 | version | 1.7.2 |
* | 2 | db_version | 1337 |
* | 3 | next_id | 69 |
* +-----------+-------------+--------------+
@ozh
ozh / allplugins.php
Last active Aug 15, 2017
Git clone all YOURLS plugins
View allplugins.php
<?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 Jul 24, 2018
Facebook Congrats & Kisses animations
View Facebook-xoxo-Congrats.md

Hearts & kisses :

  • xo
  • xoxo
  • xoxoxo
  • Besos y abrazos
  • bisou
  • bisous
  • baci
  • 꽁냥꽁냥
@ozh
ozh / plugin.php
Last active Jan 14, 2019
YOURLS plugin: keep query string
View plugin.php
<?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');
You can’t perform that action at this time.