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 / social.js
Last active September 27, 2015 12:07
Асинхронный код для социальной кнопки ВКонтакте
(function(w, d) {
// В этот массив можно вставить и другие социальные плагины, например: Google+, Facebook, Twitter
var u = ['//vk.com/js/api/openapi.js?75'],
i = u.length,
n = 'script',
f = d.createDocumentFragment(),
e = d.createElement(n),
t;
@meritt
meritt / deploy.rb
Created November 1, 2011 22:21
Capistrano config for NodeJS application
set :application, "simonenko.su"
set :node_file, "server.coffee"
set :host, "178.79.189.200"
set :repository, "git@github.com:meritt/simonenko.su.git"
set :user, "root"
set :admin_runner, "www"
set :scm, :git
set :branch, "master"
set :deploy_via, :remote_cache
@meritt
meritt / deploy.rb
Created November 21, 2011 22:32
Настройка whenever для запуска CoffeeScript в кроне (доставка с помощью Capistrano)
set :application, "simonenko.su"
set :node_file, "server.coffee"
set :host, "178.79.189.200"
set :repository, "git@github.com:meritt/simonenko.su.git"
set :user, "root"
set :admin_runner, "www"
set :scm, :git
set :branch, "master"
set :deploy_via, :remote_cache
@meritt
meritt / snippets.html
Last active September 28, 2015 22:08
Асинхронный скрипт подключения к Google Analytics отслеживания социальных кнопок
<!-- Twitter -->
<a href="http://twitter.com/share" class="twitter-share-button" data-lang="ru" data-url="http://simonenko.su">Tweet</a>
<!-- Facebook Like -->
<div class="fb-like" data-href="http://simonenko.su" data-layout="button_count" data-send="false" data-show-faces="true"></div>
<!-- Google +1 -->
<div class="g-plusone" data-href="http://simonenko.su"></div>
<!-- ВКонтакте "Мне нравится" -->
@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
@meritt
meritt / traits.php
Created March 11, 2012 10:54
Traits example
<?php
trait Hello
{
public function sayHello()
{
echo 'Hello ';
}
}
@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 / 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 / example1.coffee
Created August 12, 2012 16:31
Пример работы компилятора CS -> JS
options = {} unless options?
options.type = type if type?
body {
font: 25px/1 Arial;
}