This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$token = ''; // access_token | |
$antigate_key = ''; // http://antigate.com/panel.php?action=showkey | |
$online = api('account.setOnline', 'access_token='.$token); // Продлеваем online на 15 минут | |
if(isset($online["error"]["captcha_img"])) { | |
$img_captcha = $online["error"]["captcha_img"]; | |
$captcha_sid = $online["error"]["captcha_sid"]; | |
$antigate_response = antigate($antigate_key, $img_captcha); | |
//var_dump($antigate_response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url ='https://disqus.com/api/3.0/threads/close.json?api_secret=xxx...'; | |
$header = array("Accept: application/json"); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); | |
curl_setopt($ch, CURLOPT_ENCODING, "gzip"); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); | |
curl_setopt($ch, CURLOPT_URL, $url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
window.exports = { | |
activate : function (a,b,c) { | |
$("pre").addClass("prettyprint linenums"); | |
PR.prettyPrint(); | |
} | |
} | |
</script> | |
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?autoload=true&callback=activate"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------------------------- | |
// markItUp! Universal MarkUp Engine, JQuery plugin | |
// v 1.1.12 | |
// Dual licensed under the MIT and GPL licenses. | |
// ---------------------------------------------------------------------------- | |
// Copyright (C) 2007-2011 Jay Salvat | |
// http://markitup.jaysalvat.com/ | |
// ---------------------------------------------------------------------------- | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function translit($str) { | |
$iso9_table = array( | |
'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Ѓ' => 'G', | |
'Ґ' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'YO', 'Є' => 'YE', | |
'Ж' => 'ZH', 'З' => 'Z', 'Ѕ' => 'Z', 'И' => 'I', 'Й' => 'J', | |
'Ј' => 'J', 'І' => 'I', 'Ї' => 'YI', 'К' => 'K', 'Ќ' => 'K', | |
'Л' => 'L', 'Љ' => 'L', 'М' => 'M', 'Н' => 'N', 'Њ' => 'N', | |
'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', | |
'У' => 'U', 'Ў' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'TS', | |
'Ч' => 'CH', 'Џ' => 'DH', 'Ш' => 'SH', 'Щ' => 'SHH', 'Ъ' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) 2013 Vladimir Babin <[email protected]> | |
* Функция для сокращения текста (cut) по тегам переноса строки | |
* $post - текст для сокращения | |
* $from - минимальное количество символов | |
* $until - максимальное количество символов | |
* $intro - возможность передать текст вступления вручную | |
* $allowable_tags - разрешенные теги | |
*/ | |
public function cut($post, $from=300, $until=1000, $intro='', $allowable_tags = '<br>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set("memory_limit", "1024M"); | |
set_time_limit(0); | |
// setup the WordPress environment | |
define( "WP_INSTALLING", true ); | |
require( dirname(__FILE__) . '/wp-load.php' ); | |
require( 'wp-blog-header.php' ); | |
require_once( ABSPATH . WPINC . '/registration.php' ); | |
require_once(ABSPATH . "wp-admin/includes/taxonomy.php"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function change_slug_for_attachment($id) { | |
$post = get_post($id); | |
$post->post_name = uniqid('attachment'); | |
wp_update_post($post); | |
} | |
add_action('add_attachment', 'change_slug_for_attachment'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
f=$(pwd) | |
sips --resampleWidth 29 "${f}/${1}" --out "${f}/01iPhoneSpotlight56_29pt.png" | |
sips --resampleWidth 58 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 87 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 80 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 120 "${f}/${1}" --out "${f}/[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('America/Los_Angeles'); | |
$mysqli = new mysqli("localhost:8889", "root", "root", "kripipastacom"); | |
if ($mysqli->connect_errno) { | |
echo "Не удалось подключиться к MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; | |
} | |
$file = fopen('export.xml', "w+"); | |
$header = '<?xml version="1.0" encoding="UTF-8" ?> |
OlderNewer