Skip to content

Instantly share code, notes, and snippets.

View dmacompton's full-sized avatar
🤣

Dmytro Mykhailov dmacompton

🤣
View GitHub Profile
@dmacompton
dmacompton / javascript_resources.md
Created August 25, 2014 20:08 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@dmacompton
dmacompton / css_resources.md
Created August 25, 2014 20:08 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@dmacompton
dmacompton / variable.js
Created March 11, 2015 07:01
variables name
// название переменных
obj, data, value, item, elem, num, arr
@dmacompton
dmacompton / ip.php
Last active August 29, 2015 14:16
Testing by ip
// Тест для netpeak ip old-ip 85.238.98.189
if($_SERVER["REMOTE_ADDR"]=='217.20.181.97'){
echo($url);
}
@dmacompton
dmacompton / frotend-service.txt
Created March 11, 2015 19:36
Frontend Service
1. Prepros
http://alphapixels.com/prepros/
Компиляция, сжатие, оптимизация и еще много полезных возможностей!
2. Webflow
https://webflow.com
drag & drop редактор для создания респонсивных сайтов.
3. html2pdf
http://www.html2pdf.it
if ($_SERVER['REQUEST_URI'] == '/women/majkifutbolki/288/') {
header("HTTP/1.0 404 Not Found");
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
// $this->redirect('404.php');
$this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
//перенаправляем на страницу 404
return $this->forward('error/not_found');
@dmacompton
dmacompton / alert-php.php
Last active October 8, 2015 14:24
alert php
echo '<script>console.log('. ${1:$_SERVER} .');</script>';
@dmacompton
dmacompton / translit.php
Last active January 19, 2020 23:06
Translit php
//Транслит строки
function translit_str($str){
$tr = array(
"А"=>"a","Б"=>"b","В"=>"v","Г"=>"g",
"Д"=>"d","Е"=>"e","Ё"=>"yo","Ж"=>"zh","З"=>"z","И"=>"i",
"Й"=>"y","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n",
"О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t",
"У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch",
"Ш"=>"sh","Щ"=>"shch","Ъ"=>"","Ы"=>"y","Ь"=>"",
"Э"=>"e","Ю"=>"yu","Я"=>"ya","а"=>"a","б"=>"b",
@dmacompton
dmacompton / slonen
Created March 30, 2015 09:56
Склонение php
function sklonen($n,$s1,$s2,$s3, $b = false){
$m = $n % 10; $j = $n % 100;
if($b) $n = '<b>'.$n.'</b>';
if($m==0 || $m>=5 || ($j>=10 && $j<=20)) return $n.' '.$s3;
if($m>=2 && $m<=4) return $n.' '.$s2;
return $n.' '.$s1;
}
var_dump(sklonen(10, 'комната', 'комнаты', 'комнат'));
@dmacompton
dmacompton / substr()
Created April 16, 2015 08:28
Обрезаная строка с …
<? echo substr($addressText, 0, 43).'…'; ?>