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
require 'oauth2' | |
require 'mechanize' | |
@client = OAuth2::Client.new( | |
'client_id', | |
'client_secret', | |
:site => 'https://api.vk.com/', | |
:token_url => '/oauth/token', | |
:authorize_url => '/oauth/authorize' | |
) |
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
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'oauth2' | |
require 'json' | |
require 'haml' | |
CLIENT_SECRET = '***' | |
CLIENT_ID = '***' |
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
/ Допускається будь-який варіант | |
h1 class=page_header_class = page_header | |
h1{class=page_header_class} = page_header | |
h1[class=page_header_class] = page_header | |
h1(class=page_header_class) = page_header | |
/ При використанні обгортки, атрибути можуть займати кілька рядків | |
h1( class=page_header_class | |
id="myid")= page_header |
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
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'slim' | |
require 'warden' | |
require 'dm-core' | |
require 'dm-migrations' | |
DataMapper::Logger.new(STDOUT, :debug) |
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
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'slim' | |
require 'warden' | |
require 'dm-core' | |
require 'dm-migrations' | |
require 'dm-timestamps' | |
require 'dm-validations' |
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
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'slim' | |
require 'warden' | |
require 'dm-core' | |
require 'dm-migrations' | |
require 'dm-timestamps' | |
require 'dm-validations' |
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
class Account | |
include DataMapper::Resource | |
property :id, Serial | |
property :name, String | |
##### | |
# 1 # | |
##### One-to-many-through | |
# Користувач є власником безлічі подій |
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
class BootstrapLinkRenderer < ::WillPaginate::Sinatra::LinkRenderer | |
protected | |
def html_container(html) | |
tag :div, tag(:ul, html), container_attributes | |
end | |
def page_number(page) | |
tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page) | |
end |
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
set nocompatible "don't need to keep compatibility with Vi | |
filetype plugin indent on "enable detection, plugins and indenting in one step | |
syntax on "Turn on syntax highlighting | |
set cursorline "underline the current line in the file | |
set cursorcolumn "highlight the current column. Visible in GUI mode only. | |
set fileencodings=utf-8,cp1251,cp866,koi8-u |
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
# -*- encoding: utf-8 -*- | |
#http://en.wiktionary.org/wiki/Index:Chinese_radical | |
ua_cn = { | |
'а' => '开', | |
'б' => '石', | |
'в' => '阝', | |
'г' => '厂', | |
'ґ' => '广', |
OlderNewer