Skip to content

Instantly share code, notes, and snippets.

View ar7n's full-sized avatar
🪲
working hard

Arseny Sysolyatin ar7n

🪲
working hard
View GitHub Profile
@ar7n
ar7n / installphp7.sh
Created December 4, 2015 06:30 — forked from tronsha/installphp7.sh
Install PHP7 to Ubuntu
#!/bin/bash
apt-get update
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7
cd /tmp
git clone https://github.com/php/php-src.git --depth=1
cd php-src
./buildconf
@ar7n
ar7n / comments.css
Last active August 29, 2015 14:26
Idiomatic css comments style
/* ==========================================================================
Section comment block
========================================================================== */
/* Sub-section comment block
========================================================================== */
/**
* Short description using Doxygen-style comment format
*
@ar7n
ar7n / devdependencies.js
Created July 16, 2015 08:31
Gulp dev dependencies
"devDependencies": {
"browser-sync": "^2.2.1",
"del": "^1.1.1",
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2",
"gulp-filter": "^2.0.2",
"gulp-less": "^3.0.1",
"gulp-minify-css": "^1.1.1",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.4",
@ar7n
ar7n / scroll-to.js
Created July 12, 2015 09:02
jQuery scroll to element
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#elementtoScrollToID").offset().top
}, 2000);
});
@ar7n
ar7n / media-queries.less
Last active August 29, 2015 14:24
Bootstrap media queries
@media(max-width:767px){} // xs
@media(min-width:768px) and (max-width:991px){} // sm
@media(min-width:992px) and (max-width:1199px){} // md
@media(min-width:1200px){} // lg
@media(max-width:991px){} // xs - sm
@media(max-width:1199px){} // xs - md
@media(min-width:768px) and (max-width:1199px){} // sm - md
@media(min-width:768px){} // sm - lg
@media(min-width:992px){} // md - lg
@ar7n
ar7n / fontface.less
Last active August 29, 2015 14:24
Font-face less mixin
.include-custom-font(@family: arial, @file: arial, @weight: normal, @style: normal){
@font-face{
font-family: @family;
src:url('/fonts/@{file}.eot');
src:url('/fonts/@{file}.eot?#iefix') format('embedded-opentype'),
url('/fonts/@{file}.woff') format('woff'),
url('/fonts/@{file}.ttf') format('truetype'),
url('/fonts/@{file}.svg#icon') format('svg');
font-weight: @weight;
font-style: @style;
@ar7n
ar7n / gulpfile.js
Last active August 29, 2015 14:24
Gulpfile
var gulp = require('gulp'),
browserSync = require('browser-sync'),
mainBowerFiles = require('main-bower-files'),
less = require('gulp-less'),
filter = require('gulp-filter'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCss = require('gulp-minify-css'),
spritesmith = require('gulp.spritesmith'),
del = require('del'),
@ar7n
ar7n / plural.js
Created July 1, 2015 16:34
Russian plurals in js
function plural(number, one, two, five) {
var number = Math.abs(number);
number %= 100;
if (number >= 5 && number <= 20) {
return five;
}
number %= 10;
if (number == 1) {
return one;
}
@ar7n
ar7n / gist:90f910277ffbd2140df2
Created June 26, 2015 11:25
Set different permissions for files and folders
find /path/to/base/dir -type d -print0 | xargs -0 chmod 755
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644
@ar7n
ar7n / plural
Last active August 29, 2015 14:22 — forked from fomigo/gist:2382775
<?php
/*
echo plural_form(42, array('арбуз', 'арбуза', 'арбузов'));
*/
function plural_form($n, $forms) {
return $n%10==1&&$n%100!=11?$forms[0]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$forms[1]:$forms[2]);
}