require "stil/gd-text": "^1.1",
class ControllerClass extends Controller
{
public function __invoke($slug)
{
$post = WinkPost::where('slug', $slug)->first();
$quickDip = $post->tags()->whereSlug('quick-dip')->first() ;
<!-- | |
This is a simple URL share button for Telegram application. | |
It's compatible with iOS/Android app, Telegram Desktop and uses its web mode for fallback. | |
--> | |
<a href="https://t.me/share/url?url={url_to_share}&text={caption_text}&to={phone_number}"> | |
Share Me | |
</a> | |
<!-- |
/*Вставляем в теле сайта*/ | |
<body> | |
<a class="btn_telegram_share" href="https://telegram.me/share/url?url=ВАШ_URL&text=ТЕКСТ">Поделиться</a> | |
</body> | |
</html> | |
/*Вставляем CSS стиль*/ |
$(document).ready(function() { // вся магия после загрузки страницы | |
$("#ajaxform").submit(function(){ // перехватываем все при событии отправки | |
var form = $(this); // запишем форму, чтобы потом не было проблем с this | |
var error = false; // предварительно ошибок нет | |
form.find('input, textarea').each( function(){ // пробежим по каждому полю в форме | |
if ($(this).val() == '') { // если находим пустое | |
alert('Заполните поле "'+$(this).attr('placeholder')+'"!'); // говорим заполняй! | |
error = true; // ошибка | |
} | |
}); |
<?php | |
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> | |
* @copyright Copyright 2012 Sean Murphy. All rights reserved. |
require "stil/gd-text": "^1.1",
class ControllerClass extends Controller
{
public function __invoke($slug)
{
$post = WinkPost::where('slug', $slug)->first();
$quickDip = $post->tags()->whereSlug('quick-dip')->first() ;
<?php | |
// This middleware save utm query from url while redirect | |
// It's require Spatie\Url (https://github.com/spatie/url) | |
namespace App\Http\Middleware; | |
use Closure; | |
use Spatie\Url\Url; | |
class KeepUTMRedirect |
C:\Users\MyUser\Downloads\beanstalkd-1.4.6-cygwin\bin\beanstalkd.exe -l 127.0.0.1 -p 11300 |
window.onload = function() { | |
// Parse the URL | |
function getParameterByName(name) { | |
var name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); | |
var results = regex.exec(location.search); | |
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
// Give the URL parameters variable names | |
var source = getParameterByName('utm_source'); |
<?php | |
/** | |
* Turn all URLs in clickable links. | |
* | |
* @param string $value | |
* @param array $protocols http/https, ftp, mail, twitter | |
* @param array $attributes | |
* @param string $mode normal or all | |
* @return string | |
*/ |