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 / devices.css
Last active August 29, 2015 14:17
Media Queries for Standard Devices
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
@ar7n
ar7n / .gitignore
Last active August 29, 2015 14:17
universal gitignore
# Numerous always-ignore extensions
*.diff
*.err
*.log
*.orig
*.rej
*.swo
*.swp
*.vi
*~
@ar7n
ar7n / clearfix
Last active August 29, 2015 14:17 — forked from designsdrivegists/clearfix
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
@ar7n
ar7n / porting.sh
Created April 14, 2015 15:12
MODX porting script
find . -name "*.php" | xargs sed -i "s#/old/path/to/site/#/new/path/to/site/#g"
find . -name "*.php" | xargs sed -i "s#old-domain.com#new-domain.com#g"
@ar7n
ar7n / sticky-footer.css
Created May 12, 2015 18:19
Sticky footer
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@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]);
}
@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.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 / 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'),