Skip to content

Instantly share code, notes, and snippets.

View tanraya's full-sized avatar

Andrew Kozlov tanraya

  • Astana, Kazakhstan
View GitHub Profile

Configure server for deploy rails app

Objective

Prepare a server for a Rails app with MySQL (percona) + NGINX (passenger)
Deploy rails app in new server with Capistrano v3

For this example we need :

var data = [
['strong', 0, 5],
['span', 0, 5],
['em', 2, 5]
];
var text = 'hello';
//function vtext(t) {}
//function vnode(name, attrs, chldren) {}
var data = [
[0, 5],
[0, 5],
[2, 5],
[5, 6],
[6, 8],
[6, 11],
];
// Сортировка по левому значению
class Tagger {
constructor(text, markup = []) {
this.text = text;
this.markup = this.cloneMarkup(markup);
}
cloneMarkup(markup) {
let result = [];
markup.forEach((x) => {
result.push([ x[0], x[1], x[2] ])
├── organization
│   ├── industry.rb
│   ├── partnership.rb
│   ├── person.rb
│   └── publication.rb
├── organization.rb
/*
jQuery FormWatch: easily monitor changes in form data.
https://github.com/kylefox/jQuery-FormWatch
Version 0.1
*/
(function($) {
var timeout_id;
function _eventArgs() {
return $.map(arguments, function(arg) {

Что хочется:

  • Использовать Webpack
  • Никакого SCSS, вместо него PostCSS + плагины
  • Только ES6
  • Ассеты хранятся там же, где их хранит рельса (конфигурируемо)
  • Поддержка JSX
  • Интеграция с Rails (хелперы) и Capistrano 3
  • Генератор-установщик для Rails
  • Поддержка Foreman
@tanraya
tanraya / CSS3-Logic-Gates-using-Checkboxes.markdown
Created November 22, 2014 12:58
CSS3 Logic Gates using Checkboxes
# encoding: utf-8
require 'yaml'
require 'unicode_utils'
module Petrovich
NOMINATIVE = :nominative # именительный
GENITIVE = :genitive # родительный
DATIVE = :dative # дательный
ACCUSATIVE = :accusative # винительный
INSTRUMENTAL = :instrumental # творительный
inputs = %w[
CollectionSelectInput
DateTimeInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput