Skip to content

Instantly share code, notes, and snippets.

View serhiinkh's full-sized avatar
🏠
Working from home

Serhii Nakhankov serhiinkh

🏠
Working from home
View GitHub Profile
-Блог/Новости
-Пагинация как плагин
-Меню можно встроенное или как плагин до 2 - 3 уровней вложености
-Менеджер файлов
-Текстовый редактор для шаблонов
-Сниппеты/Шорткоды для плагинов по типу {blog} {blog-list}
-Фотогалерея/Портфолио
-Кеширование
-Локализация
-Плагины...
@serhiinkh
serhiinkh / gist:8118923
Last active January 1, 2016 08:29
Archiever class
<?php
class Archiver
{
protected $output = array();
public function pack($source, $destination=null)
{
$source = realpath($source);
$sourcePath = dirname($source);
@serhiinkh
serhiinkh / gist:8123747
Last active January 1, 2016 09:18
zip/unzip files with cyrilic not finished....
<?php
class Archiver
{
protected $files = array();
public function pack($source, $archivePath=null)
{
@serhiinkh
serhiinkh / gist:8397910
Created January 13, 2014 10:31
Captcha
<?php
class Captcha
{
private static function generate() {
$fontFile = './captcha.ttf';
$fontSize = 18;
$charsAmount = 5;
$chars = '23456789BCDFGHJKMNPQRSTVWXYZ';
$stringOffsetX = 5;
https://github.com/bcosca/fatfree/blob/master/lib/web.php#L723
@serhiinkh
serhiinkh / gen
Last active August 29, 2015 13:58
<?php
error_reporting(-1);
class Avatar
{
private $path = './images/';
private $config = array(
0 => 'backgrounds',
1 => 'bodies',
2 => 'accessories',
3 => 'effects',
// --- INIT
var gulp = require('gulp'),
less = require('gulp-less'), // compiles less to CSS
minify = require('gulp-minify-css'), // minifies CSS
concat = require('gulp-concat'),
uglify = require('gulp-uglify'), // minifies JS
rename = require('gulp-rename'),
browserSync = require('browser-sync');
// Start the server
<snippet>
<content><![CDATA[
die(var_dump($1));
]]></content>
<tabTrigger>dd</tabTrigger>
<scope>source.php</scope>
<description>die(var_dump(...))</description>
</snippet>
@serhiinkh
serhiinkh / gist:2e21c57a09526b3a62d8
Created February 24, 2015 22:22
Columns generator
for(var i = 1, max = 6; i < max; i++) {
for(var f = i + 1; f < 7; f++) {
columns = i;
margin = (f - 1) * 4;
width = (100 - margin) / f;
if (columns > 1) {
width = (width * columns) + ((columns - 1) * 4);
}
console.log(i + '/' + f + ' col: width:' + Math.floor(width * 1000) / 1000);
}
@serhiinkh
serhiinkh / nginx
Last active November 21, 2015 23:09
#map $status $loggable {
# ~^[2,3] 0;
# default 1;
#}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name ~^(www\.)?(?<domain>.+?).loc$;