Skip to content

Instantly share code, notes, and snippets.

View swuppio's full-sized avatar
😋
Working from home

swuppio

😋
Working from home
View GitHub Profile
'mimeTypes' => 'application/zip, text/plain, application/x-dbf, application/vnd.ms-excel',
'checkExtensionByMimeType' => false
SELECT DATE_FORMAT(STR_TO_DATE('10.11.2012 11:10:12','%d.%m.%Y %H:%i:%s'),'%Y-%m-%d %H:%i:%s');
@swuppio
swuppio / htac
Created February 16, 2017 19:55
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
$iv = openssl_random_pseudo_bytes(16);
$secure = base64_encode(openssl_encrypt('misha', 'AES-128-CBC','mykey', OPENSSL_RAW_DATA, $iv));
echo openssl_decrypt(base64_decode($secure), 'AES-128-CBC','mykey', OPENSSL_RAW_DATA, $iv);
die;
@swuppio
swuppio / govnogod.php
Last active August 3, 2017 15:21
govnogod
exportSellerOffersTable = function (url,id)
{
window.open(url+'?id='+id);
};
<?php
echo Html::button(
'Экспорт данных',
array('class' => 'btn btn-primary pull-left',
'onClick'=>sprintf('exportSellerOffersTable("' . Yii::$app->urlManager->createUrl(['/lk/exportselleroffers']) . '",'.$model->lot_data['id'].')'))
@swuppio
swuppio / have to know
Created July 24, 2017 10:47
have to know
убираем паджакс у ссылок внутри пджакса ['data-pjax' => 0]
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use yii\web\UploadedFile;
class Uploader extends Model
{
public $img;
public function rules()
{
background: linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8, #1098ad, #07b39b, #6fba82);
https://habrahabr.ru/post/340460/
http://www.fontspace.com/firstsiteguide/blogger-sans