Skip to content

Instantly share code, notes, and snippets.

View v-sorokin's full-sized avatar

Vitaly Sorokin v-sorokin

View GitHub Profile
@v-sorokin
v-sorokin / .gitlab-ci.yml
Created March 28, 2019 08:14
GitLab CI example for Node.JS (pm2)
image: node:7.7.0
cache:
key: "$CI_PROJECT_ID"
paths:
- node_modules/
before_script:
- npm set progress=false
@v-sorokin
v-sorokin / services.js
Created September 8, 2016 09:39 — forked from bullgare/services.js
form serialization in pure js
serialize: function serialize(form)
{
if (!form || form.nodeName !== "FORM") {
return;
}
var i, j,
obj = {};
for (i = form.elements.length - 1; i >= 0; i = i - 1) {
if (form.elements[i].name === "") {
continue;
/// Base path for assets (fonts, images...),
/// should not include trailing slash
/// @access public
/// @type String
$asset-base-path: '../assets' !default;
/// Asset URL builder
/// @access private
/// @param {String} $type - Asset type, matching folder name
/// @param {String} $file - Asset file name, including extension
@v-sorokin
v-sorokin / convert_sass_to_scss
Created October 29, 2015 13:00 — forked from knowuh/convert_sass_to_scss
convert sass to scss by example
#convert .sass files to scss files:
bundle exec sass-convert -R --from sass --to scss ./public/stylesheets/sass/
# delete the old sass files:
find ./public/stylesheets/sass -name "*.sass" | xargs rm
# rename the directory.
mv ./public/stylesheets/sass ./public/stylesheets/scss
@v-sorokin
v-sorokin / config.js
Last active August 29, 2015 14:22 — forked from moimikey/config.js
module.exports = {
port: 8000,
globals: {
$: 'jquery',
jQuery: 'jquery',
_: 'lodash',
Backbone: 'backbone',
Marionette: 'backbone.marionette',
moment: 'moment'
},
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.2
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http*://*
// ==/UserScript==
@v-sorokin
v-sorokin / .jshintrc.js
Last active August 29, 2015 14:18 — forked from connor/.jshintrc.js
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@v-sorokin
v-sorokin / placeholder.scss
Created August 14, 2013 09:54 — forked from antsa/placeholder.scss
A mixin to style placeholders in HTML5 form elements. Includes also a .placeholder class to be used with a polyfill e.g. https://github.com/mathiasbynens/jquery-placeholder Requires Sass 3.2.
// Placeholder @mixin for Sass
// Example usage (.scss):
//
// input {
// @include placeholder {
// /* styles for placeholder here */
// }
// }
//
@v-sorokin
v-sorokin / transparent.scss
Created January 26, 2013 21:03
Mixin for transparent property with fallback
@mixin transparent($color, $alpha) {
$rgba: rgba($color, $alpha);
$ie-hex-str: ie-hex-str($rgba);
background-color: transparent;
background-color: $rgba;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str},endColorstr=#{$ie-hex-str});
zoom: 1;
}
@v-sorokin
v-sorokin / multiple_box_shadow.scss
Last active December 11, 2015 17:28
Multiple box-shadow property in one sass mixin
@mixin box-shadow($shadow1, $shadow2:false, $shadow3:false, $shadow4:false, $shadow5:false) {
$params: $shadow1;
@if $shadow2
{ $params: $shadow1, $shadow2; }
@if $shadow3 != false
{ $params: $shadow1, $shadow2, $shadow3; }
@if $shadow4 != false
{ $params: $shadow1, $shadow2, $shadow3, $shadow4; }
@if $shadow5 != false
{ $params: $shadow1, $shadow2, $shadow3, $shadow4, $shadow5; }