Skip to content

Instantly share code, notes, and snippets.

View meritt's full-sized avatar
🎯
Focusing

Alexey Simonenko meritt

🎯
Focusing
View GitHub Profile
@meritt
meritt / build.coffee
Created November 23, 2012 07:57
Обновление версии для статики в шаблонах сайта
(root, fn) ->
glob 'views/**/*.hbs', {}, (error, files) ->
for file in files
source = fs.readFileSync "#{root}/#{file}", 'utf8'
update = false
for filename, version of options.version
if source.indexOf(filename) > -1
update = true
@meritt
meritt / twitter-cards-author.html
Created November 19, 2012 14:02
Пример настроек страницы для Twitter Cards
<meta name="twitter:site" content="@simonenko">
<meta name="twitter:creator" content="@simonenko">
@meritt
meritt / class.js
Created November 7, 2012 13:44
Нужны ли классы в JavaScript?
function MyCustomType(value) {
this.property = value;
}
MyCustomType.prototype.method = function() {
return this.property;
};
body {
font: 25px/1 Arial;
}
@meritt
meritt / example1.coffee
Created August 12, 2012 16:31
Пример работы компилятора CS -> JS
options = {} unless options?
options.type = type if type?
@meritt
meritt / retina.js
Created July 23, 2012 11:24
Detect retina screens
function isRetina() {
return (('devicePixelRatio' in window && devicePixelRatio > 1) || ('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches));
}
@meritt
meritt / clients.js
Created April 9, 2012 11:19
Twitter Streaming API on CoffeeScript
var socket = io.connect('http://127.0.0.1:8080');
socket.on('connect', function() {
socket.on('message', function(tweet) {
var tweet = JSON.parse(tweet), content = '';
content = '<div class="name">' + tweet.name + '</div>';
content += '<div class="text">' + tweet.text + '</div>';
$('#tweets').prepend(content);
});
@meritt
meritt / traits.php
Created March 11, 2012 10:54
Traits example
<?php
trait Hello
{
public function sayHello()
{
echo 'Hello ';
}
}
@meritt
meritt / php.ini
Created March 11, 2012 08:36
Config for PHP 5.4 in development env
[PHP]
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14