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;
@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 / _pems.scss
Created September 21, 2012 13:49 — forked from mrdanadams/_pems.scss
PX to EMs conversion in Sass
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;
@v-sorokin
v-sorokin / gist:3447379
Created August 24, 2012 08:12 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@v-sorokin
v-sorokin / _media-queries.scss
Created August 20, 2012 20:15 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break