This file contains 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
module Alfalek | |
class MegaSearch < Grape::API | |
INDEX_SOURCE = [ | |
{klass: Doctor, cols: %w{title fname lname short_description}}, | |
{klass: DiagnosticCategory, cols: %w{name description}}, | |
{klass: LaboratoryCategory, cols: %w{name description}}, | |
{klass: MicrobiologyCategory, cols: %w{name description}}, | |
{klass: RehabilitationCategory, cols: %w{name description}}, | |
{klass: TreatmentCategory, cols: %w{name description}} |
This file contains 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
# @cjsx React.DOM | |
@PaginatorSection = React.createClass | |
displayName: 'PaginatorSection' | |
_handleOnClick: (pageNumber) -> | |
@props.onPaginate(pageNumber) | |
_handleNextClick: (e) -> | |
e.preventDefault(); |
This file contains 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
# @cjsx React.DOM | |
@ArticlesSection = React.createClass | |
displayName: 'ArticlesSection' | |
getInitialState: -> | |
didFetchData: false | |
articles: [] | |
meta: | |
total_pages: 0 |
This file contains 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
// Patches https://github.com/Dogfalo/materialize/blob/b03030ed5c5ea2018424e2b6a73084f65e8ec63d/js/buttons.js | |
// minor changes here, search for `downwards` | |
(function ($) { | |
angular.element(document).ready(function() { | |
// jQuery reverse | |
$.fn.reverse = [].reverse; | |
// unbind existing handlers | |
angular.element(document).off('mouseenter.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle)'); |
This file contains 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
const path = require('path') | |
const webpack = require('webpack') | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
const CleanWebpackPlugin = require('clean-webpack-plugin') | |
module.exports = { | |
context: __dirname, | |
entry: './src/index.js', | |
output: { |
This file contains 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
# Puma can serve each request in a thread from an internal thread pool. | |
# The `threads` method setting takes two numbers a minimum and maximum. | |
# Any libraries that use thread pools should be configured to match | |
# the maximum value specified for Puma. Default is set to 5 threads for minimum | |
# and maximum, this matches the default thread size of Active Record. | |
# | |
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i | |
threads threads_count, threads_count | |
# Specifies the `port` that Puma will listen on to receive requests, default is 3000. |
This file contains 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
def self.from_omniauth(auth, opts = {}) | |
where('(provider = :provider AND uid = :uid) OR email = :email', | |
provider: auth.provider, | |
uid: auth.uid, | |
email: auth.info.email).first_or_initialize.tap do |user| | |
user.provider = auth.provider | |
user.uid = auth.uid | |
user.oauth_token = auth.credentials.token |
This file contains 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
// Examples: | |
// no-margin-bottom, no-padding-left, margin-top-5, padding-left-20, etc | |
$directions: ('top' 'bottom' 'left' 'right'); | |
$properties: ('margin' 'padding'); | |
@each $direction in $directions { | |
@each $property in $properties { | |
.no-#{$property}-#{$direction} { |
This file contains 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
namespace :workers do | |
namespace :clockwork do | |
desc "Stop clockwork" | |
task :stop do | |
on roles(:app) do | |
within release_path do | |
with rails_env: fetch(:rails_env) do | |
execute :bundle, :exec, :clockworkd, "-c lib/clockwork.rb --pid-dir=#{cw_pid_dir} --log-dir=#{cw_log_dir} stop" | |
end | |
end |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |