This file contains hidden or 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
setCodeTextarea: function(code) | |
{ | |
this.$el.val(code).trigger('change'); | |
} |
This file contains hidden or 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(){ | |
$('img.expand').each(function(key, el){ | |
var $el = $(el) | |
, image | |
, originalWidth, originalHeight | |
, width, height; | |
width = $el.attr('width'); | |
height = $el.attr('height'); |
This file contains hidden or 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
# Fedora 17 x86_64 | |
cd /tmp | |
yum install -y gnome-tweak-tool light-theme-gnome gconf-editor && \ | |
su corpix -c 'dconf write /org/gnome/shell/overrides/button-layout \'"close,minimize,maximize:"\'' && \ | |
wget http://font.ubuntu.com/download/ubuntu-font-family-0.80.zip | |
CHROME_REPO="/etc/yum.repos.d/google-chrome.repo" |
This file contains hidden or 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 obj = { | |
a: { | |
b: 1 | |
} | |
} | |
'a.b.etc'.split('.').reduce(function (obj,i) { | |
return 'object' == typeof obj ? obj[i] || false : false; | |
}, obj); |
This file contains hidden or 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
server { | |
listen 80; | |
server_name cloud.yourhost.ru; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
# HTTPS | |
server { | |
listen 443 ssl; | |
server_name cloud.yourhost.ru; |
This file contains hidden or 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
[www] | |
listen = /var/run/php-fpm/php-fpm.sock | |
listen.owner = php-fpm | |
listen.group = php-fpm | |
listen.mode = 0666 | |
user = php-fpm | |
group = php-fpm |
This file contains hidden or 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
// Wide | |
function () { | |
$(this).find('img.normal').fadeOut(300); | |
$(this).find('img.wide').fadeIn(300); | |
$(this).animate({ width: '340px', height: '134px' }, 200); | |
$(this).parent().animate({ top: '-16px', left: '-17px' }, 200); | |
$(this).parent().css('z-index', '100'); | |
}; |
This file contains hidden or 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 obj, key, arr; | |
obj = { | |
foo: 'bar', | |
baz: 'faz' | |
}; | |
for(key in obj){ | |
console.log(key, ':', obj[key]); | |
} |
This file contains hidden or 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 i = 0; | |
console.log('Setting timeout'); | |
setTimeout(function(){ | |
console.log('Timeout callback raised'); | |
}, 500); | |
console.log('Beginning of the loop') | |
while(true){ | |
i++; |
This file contains hidden or 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 i = 0; | |
console.log('Setting timeout(500)'); | |
setTimeout(function(){ | |
console.log('Timeout callback raised'); | |
}, 500); | |
process.nextTick(function(){ | |
console.log('Beginning of the loop'); | |
while(true){ |