Skip to content

Instantly share code, notes, and snippets.

View AS87-code's full-sized avatar

Ashin Anton AS87-code

  • Ukraine
View GitHub Profile
Create package.json
npm install
npm install -g grunt-cli
---
npm install grunt-contrib-concat --save-dev //объеденение файлов
npm install grunt-contrib-uglify --save-dev //минификация кода
npm install grunt-contrib-imagemin --save-dev //оптимизация изображений
npm install grunt-contrib-sass --save-dev //scss to css
npm install grunt-contrib-compass --save-dev //compass
npm install grunt-postcss --save-dev
@AS87-code
AS87-code / Linux
Last active December 9, 2015 13:40
Post/Pre|processor's | Sass, compass, csscomb
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
### using rbenv
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
@AS87-code
AS87-code / Bootstrap - sass
Last active December 9, 2015 22:03
SCSS Framework
### Install ###
gem install bootstrap-sass // install in system
compass install bootstrap -r bootstrap-sass // if project isset
compass create my-new-project -r bootstrap-sass --using bootstrap // if create new project with install
### Use ###
style.scss
@import "bootstrap-sass-3.3.4/assets/stylesheets/bootstrap"; // if download
@import "bootstrap"; // if install with Compass
@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap"; // if install with Bower
@AS87-code
AS87-code / Constants
Last active March 18, 2016 23:31
Php
define() - объявления константы define("DBServer", "localhost");
defined() - определения наличия константы if(defined("DBServer")) echo DBServer;
***
Системные константы
__LINE__ Содержит номер текущей строки в текущем файле.
__FILE__ Содержит полное имя текущего файла
__FUNCTION__ Содержит имя текущей функции.
__CLASS__ Содержит имя текущего класса.
<script src="1.js" async> ..кто первый того и тапки
<script src="1.js" defer> ..в строгом порядке + ждет загрузки документа
<?php
if(!Mage::getSingleton('customer/session')->isLoggedIn()){
echo $this->__('Sign In');
}else{
echo $this->__('Hello, %s!', $this->helper('customer')->getCustomerName());
}
?>
@AS87-code
AS87-code / Bootstrap slider
Last active November 18, 2017 14:01
WordPress
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<?php query_posts( 'meta_key=slide&showposts=3' ); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!--HTML-->
<div class='images' id='image1'>
<div class='layer'></div>
<img src='images/picture.jpg' alt="" width="200" height="200" border="0" />
</div>
<div class='images' id='image2'>
<div class='layer'></div>
<img src='images/picture.jpg' alt="" width="200" height="200" border="0" />
</div>
<div class='images' id='image3'>
<!--[if lt IE 7]><html lang="ru" class="lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html lang="ru" class="lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html lang="ru" class="lt-ie9"><![endif]-->
<!--[if gt IE 8]><!-->
<!--<![endif]-->
#loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 9999;