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
import os | |
def create_db_engine(db_url, **kwargs): | |
return create_engine( | |
url=db_url, future=True, **kwargs | |
) | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker |
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
Process: Synchronos [96658] | |
Path: /Applications/Synchronos.app/Contents/MacOS/Synchronos | |
Identifier: io.synchronos.desktop | |
Version: 1.2 (1.2.7) | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: Synchronos [96658] | |
User ID: 501 | |
Date/Time: 2021-10-07 19:45:55.937 +0500 |
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
// rake users:import[path/to/file/on/s3] | |
task :import, %i[s3_key] => :environment do |_task, args| | |
company = User.by_email("[email protected]").company | |
departments = { | |
'Administration' => '1', | |
'Ventes' => '2', | |
'Bureau' => '3', | |
'Production' => '4', | |
'Entretien' => '5', |
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 DatasetFilter | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
def filters(filters) | |
@filters = Array(filters) | |
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
require 'spec_helper' | |
require 'ostruct' | |
class FakePostRepo | |
attr_reader :posts | |
def initialize | |
@posts = [] | |
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
FROM ruby:2.4.1-slim | |
RUN apt-get update -qq \ | |
&& apt-get install -y --no-install-recommends \ | |
apt-transport-https \ | |
curl | |
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash - && \ | |
curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ |
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
.hasDatepicker { | |
background: url(data:image/gif;base64,R0lGODlhEAAQAOZLAP%2F%2B%2Bvn5%2BampqaWlpfT49LGxsfn6%2BaqqqqysrK2tra%2FJ6rzZ8r%2Fb8qWzwpvW%2FM3m%2BrLQ62mm3FmAsWys4o%2FK9pfQ%2BVF8qKenp3ep2q%2FN6XCn28Pd8lCQz7HN6sDAwIO%2B7ZC237GvrlOCvoO04q3M6szk96CgoK6urkBytYm753qx44vA64TI%2BGuz626g1YzA6mKY0Yi86EWO1FiOysTl%2FGSr5ZTC6r3Z8X6p2MHc82Cy70yMzT5vpovQ%2FM%2Fj9Ze%2F6LbT7E%2BCvnTE%2BrnX8FqAqbCwsKioqKKiovz8%2FKampv%2F%2F%2F%2F%2F%2F%2FwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAEsALAAAAAAQABAAAAeigEuCg4SFSxIuGCMpLysxKhowM0EigkQ%2FPiUPNBUUHzYkIDgoghYyEy0sDj1COjURHDs8gg0dEEMLDBs5N0AZCgpGgiFKxQDGxgAAwksJSEfQ0dIBzAhISUoG2NrZR9SC1tgE4uLezAfXSerr6uaCAtfF2Erz7kvw8%2FnFR0jMF0gD1AVMEhBav3dKkChcyPDgEhMFikiceOJAggIFPBjaWCgQADs%3D) 2px 50% no-repeat #fff; | |
padding-left: 20px!important | |
} |
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
# web/controllers/authentication.rb | |
module Web | |
module Authentication | |
module Skip | |
def authenticate! | |
end | |
end | |
def self.included(action) | |
action.class_eval do |
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 ind(search_params) | |
@deliveries = Apress::Notifications::Admin::DeliveriesFinder.new(search_params).call | |
.paginate(:page => 1, :per_page => 20) | |
.to_a | |
@company_counts = Apress::Notifications::Company::SendsLog | |
.between(search_params[:since], search_params[:till]) | |
.where(delivery_id: @deliveries.flat_map(&:id)) | |
.count(:company_id, distinct: true, group: 'delivery_id') |
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
require 'pry' | |
require 'apress/clearance' | |
require 'apress/orders' | |
require 'active_record' | |
require 'active_support' | |
require 'combustion' | |
require 'interactor' | |
require 'tsort' | |
DO_NOT_REPLY = 'qq' |
NewerOlder