Skip to content

Instantly share code, notes, and snippets.

View nokimaro's full-sized avatar

Nik Dm nokimaro

View GitHub Profile
<?php
require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php";
/**
* Implements an [img=alt] tag that supports an optional class argument.
*
*/
class ImageWithClass extends \JBBCode\CodeDefinition
{
<?php
require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php";
/**
* Implements a [list] code definition that provides the following syntax:
*
* [list]
* [*] first item
* [*] second item

Для отображения собственной рекламы, при отсутствии рекламы из octobird, добавляется параметр passback с собственным обработчиком.

<div class="octobird-block"></div>

<script type="text/javascript">
    var _ob = {
        sid: YOUR_SITE_ID,
        passback: function () {
            //ЗДЕСЬ РЕАЛИЗУЕТСЯ ВАША ЛОГИКА, КОТОРАЯ ВЫПОЛНЯЕТСЯ ПРИ ОТСУТСТВИИ РЕКЛАМЫ В OCTOBIRD 
 console.log('Octobird does not have any ads');

###Важно! Необходимо перед установкой данного кода, удалить наш старый код

<script async src="http://show.octobird.com/ob.js"></script>
<div class="octobird-block" 
    data-site-id="3510" 
    data-ad-type="img" 
    data-ad-number="1"></div>
@nokimaro
nokimaro / is_popup_window.js
Created December 18, 2016 01:58 — forked from donut/is_popup_window.js
Is popup window
// Try to guess if the current window is a "popup"
window.isPopup =
window.isPopup || window.opener ||
(window.locationbar && window.locationbar.visible === false) ||
false;
@nokimaro
nokimaro / LICENSE.txt
Created December 18, 2016 01:58 — forked from dciccale/LICENSE.txt
Detect if Flash Player is installed in your browser (120bytes)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Denis Ciccale <http://webdecs.wordpress.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@nokimaro
nokimaro / autofit_text_to_image.php
Created January 23, 2018 16:55 — forked from clifgriffin/autofit_text_to_image.php
Auto fit text to image using PHP / Imagick
<?php
/**
* Auto Fit Text To Image
*
* Write text to image using a target width, height, and starting font size.
*
* @author Clif Griffin
* @url http://cgd.io/2014/auto-fit-text-to-an-image-with-php-and-wordpress
*
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@nokimaro
nokimaro / SimpleStore.js
Created May 18, 2018 17:02 — forked from ksafranski/SimpleStore.js
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre