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
import { useSpring } from 'react-spring'; | |
function useBoop({ | |
x = 0, | |
y = 0, | |
rotation = 0, | |
scale = 1, | |
timing = 150, | |
springConfig = { | |
tension: 300, |
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
{ | |
"nodes": [ | |
{ | |
"x": -145, | |
"y": -740, | |
"id": "0264004103", | |
"name": "Публичное акционерное общество \"НЕФАЗ\"", | |
"ssud_zad_rub": "387 000.0", | |
"zone": "Желтая зона", | |
"node_color": "yellow", |
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
/** | |
* Maps selector objects with keys | |
* | |
* @param { SelectorsMapObject } selectorsMapObject selectors map object | |
* @returns { SelectorsObject } selectors object | |
*/ | |
export function combineSelectors<S extends SelectorsMapObject, K extends keyof S>(selectorsMapObject: S): S[K] { | |
const combinedSelectors = {}; | |
Object.keys(selectorsMapObject).forEach(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
require ‘forwardable’ | |
class Blog | |
def edit_post | |
puts “Post edited” | |
end | |
def delete_post | |
puts “Post removed” | |
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
class Blog | |
def edit_post | |
puts “Post edited” | |
end | |
def delete_post | |
puts “Post removed” | |
end | |
def create_post |
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 ApplicationController < ActionController::Base | |
helper_method :filter_params | |
def filter_params | |
result = '' | |
params.except('controller', 'action').each_pair { |k, v| result += "#{k}=#{v}&" } | |
result.chop | |
end | |
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
resources :post do | |
collection do | |
get ‘pagination’ | |
end | |
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
$ -> | |
$window = $(window) | |
$document = $(document) | |
THRESHOLD = $('footer').height() | |
$paginationElem = $('.pagination') | |
# check existanse of the pagination block | |
unless $paginationElem.length | |
return |
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
.pagination{ | |
/ inline styles ONLY FOR EXAMPLE | |
/ PLEASE DO NOT USE THEM | |
style='display:none; margin:20px 0; text-align:center;' | |
data-pagination-endpoint="#{endpoint}" | |
data-pagination-pages="#{page_count}" | |
data-pagination-container="#{container}" | |
} | |
= image_tag 'ajax-loader.gif' |
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
.main-container | |
h1.page-header = t 'posts.header' | |
.posts-list | |
= render partial: 'partials/posts', locals: { posts: @posts } | |
# 'container' - where we want to load next page of posts | |
= render partial: 'partials/pagination', locals: { endpoint: @endpoint, page_count: @page_count, container: '.posts-list' } |
NewerOlder