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
function preloadImages(srcs, imgs, callback) { | |
var img; | |
var remaining = srcs.length; | |
for (var i = 0; i < srcs.length; i++) { | |
img = new Image(); | |
img.onload = function() { | |
--remaining; | |
if (remaining <= 0) { | |
callback(); | |
} |
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 i in [0...someCount] | |
doSomething() | |
# For in Obj at one line | |
for key , value of Obj then if key != Obj.length then console.log 'key', key , 'value',value |
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
module.exports = ( grunt ) -> | |
grunt.initConfig | |
pkg : grunt.file.readJSON 'package.json' | |
haml : | |
init : | |
files :[ | |
expand : true | |
cwd : 'source/haml' # From folder |
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 start configs | |
syntax on | |
filetype plugin indent on | |
set termencoding=utf-8 | |
set fileencodings=utf8,cp1251 | |
set encoding=utf8 | |
if has("autocmd") | |
autocmd BufRead *.sql set filetype = mysql |
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 strict'; | |
/** | |
* | |
* # Запуск сборки в продакшн | |
* $ NODE_ENV=production webpack | |
* | |
* # Создать файл stats.json для анализа на http://webpack.github.io/analyse | |
* $ webpack --json --profile > stats.json | |
* |
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
// Refactored loader 3 script from https://github.com/lukehaas/css-loader | |
// html -> <div class="laoder"></div> | |
// html without "loading..." like in the source | |
.loader { | |
$loader_color: #979797; | |
width: 12px; | |
height: 12px; | |
position: relative; |
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
127.0.0.1 localhost | |
127.0.0.1 mydev.app | |
192.168.0.2 mydev.app |
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
<?php | |
echo "Welcome to the OZ-TZ init script \n"; | |
$f_db_host = fopen ("php://stdin","r"); | |
$f_db_dbname = fopen ("php://stdin","r"); | |
$f_db_username = fopen ("php://stdin","r"); | |
$f_db_userpassword = fopen ("php://stdin","r"); | |
echo "Type DB host: "; | |
$db_host = fgets($f_db_host); |
OlderNewer