This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.some-block {} /*block*/ | |
.some-block__element {} /*element*/ | |
.some-block_size_large {} /*modificator of block*/ | |
.some-block__element_size_large {} /*modificator of element*/ | |
/* | |
Block may contains another blocks and elements. | |
Element may contains another blocks and elements. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Circle = function() {}; | |
Circle.prototype = { | |
area: function() { | |
return Math.PI * this.radius * this.radius; | |
}, | |
grow: function() { | |
this.radius++; | |
}, | |
shrink: function() { | |
this.radius--; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Gists to store entire functions | |
class QuickSort | |
def self.sort!(keys) | |
quick(keys,0,keys.size-1) | |
end | |
private | |
def self.quick(keys, left, right) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Eric Schoffstall https://github.com/contra author Gulp.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
compass = require('gulp-compass'), | |
express = require('express'), | |
gutil = require('gulp-util'), | |
path = require('path'), | |
refresh = require('gulp-livereload'), | |
server = require('tiny-lr')(); | |
gulp.task('expressServer', function(){ | |
app = express(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<Options xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<Enabled>true</Enabled> | |
<ErrorCategory>Error</ErrorCategory> | |
<TODOEnabled>false</TODOEnabled> | |
<TODOCategory>Task</TODOCategory> | |
<RunOnBuild>true</RunOnBuild> | |
<CancelBuildOnError>true</CancelBuildOnError> | |
<JSLintOptions> | |
<BoolOptions2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pre-commit Git hook to run JSHint on JavaScript files. | |
# | |
# If you absolutely must commit without testing, | |
# use: git commit --no-verify | |
filenames=($(git diff --cached --name-only HEAD)) | |
which jshint &> /dev/null | |
if [ $? -ne 0 ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"boss": true, | |
"node": true, | |
"browser": true, | |
"esnext": true, | |
"bitwise": true, | |
"curly": true, | |
"eqeqeq": true, | |
"immed": true, | |
"indent": 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//[twitter] https://github.com/twitter/plumage.js/blob/master/.jshintrc | |
"boss": true, | |
"node": true, //глобальные переменные node | |
"browser": true, //глобальные переменные современных браузеров | |
"esnext": true, //говорит что код использует фишки следующей спецификации JS(в нашем случае EcmaScript 6) | |
"bitwise": true, //запрещает использовать побитовые операции ^(XOR) и I(OR) | |
"curly": true, //везде фигурные скобки | |
"eqeqeq": true, //везде строгое сравнение - === | |
"immed": true, //обязывает оборачивать моментально вызываемые функции в скобки |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call | |
function Product(name, price) { | |
this.name = name; | |
this.price = price; | |
if (price < 0) | |
throw RangeError('Cannot create product ' + | |
name + ' with a negative price'); | |
return this; | |
} |