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
ul { | |
font: 14px Verdana, Geneva, sans-serif; | |
text-align: justify; | |
/* Обнуляем для родителя*/ | |
line-height: 0; | |
font-size: 1px; | |
/* 1px для Opera */ | |
/* Лекарство для IE6-7*/ | |
text-justify: newspaper; | |
zoom: 1; |
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
*** create a new repository on the command line *** | |
echo "# my-brackets-template" >> README.md | |
git init | |
git add README.md | |
git commit -m "first commit" | |
git remote add origin https://github.com/whitershade/my-brackets-template.git | |
git push -u origin master | |
*** push an existing repository from the command line *** | |
git remote add origin https://github.com/whitershade/my-brackets-template.git |
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
npm init | |
npm install webpack -g | |
npm install --save react react-dom react-router | |
npm install --save-dev babel-core babel-loader babel-preset-es2015 babel-preset-react | |
mkdir public | |
mkdir app | |
cd app | |
mkdir components | |
touch index.html |
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
JS | |
let mainHeader = document.getElementById('main-header'); | |
setMainHeaderHeight(); | |
window.onresize = function () { | |
setMainHeaderHeight(); | |
} | |
function setMainHeaderHeight() { | |
let height; | |
if (typeof document.height !== 'undefined') { | |
height = document.height // For webkit browsers |
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 BPtest = new SpeedTest( noBP,listsForTests ); | |
* BPtest.startTest(); | |
*/ | |
var SpeedTest = function(testImplement,testParams,repetitions){ | |
this.testImplement = testImplement; | |
this.testParams = testParams; | |
this.repetitions = repetitions || 10000; | |
this.average = 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
let user = { | |
name: "sam", totalReplies: 17, isBlocked: false | |
}; | |
user[Symbol.iterator] = function(){ | |
let properties = Object.keys(this); | |
let count = 0; | |
let isDone = false; |
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
Google Chrome | |
Для установки Google Chrome нужно загрузить ключ репозитория: | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c "echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google.list" | |
sudo apt-get update | |
sudo apt-get install google-chrome-stable | |
Atom | |
sudo add-apt-repository ppa:webupd8team/atom |
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
Треугольник в цикле | |
for (let i = ''; i.length < 8; i += '#') | |
console.log(i); | |
FizzBuzz | |
for (let i = 1; i <= 100; i += 1) { | |
switch (true) { | |
case i % 3 === 0 && i % 5 === 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
const array = [2, 4, 6, 10, 7, 3, 5]; | |
const qsort = array => { | |
if (array.length < 2) return array; | |
const pivot = array[Math.round(array.length / 2)]; | |
const less = array.filter(i => i < pivot); | |
const greater = array.filter(i => i > pivot); |
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
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |
OlderNewer