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
{ | |
"$schema": "http://json-schema.org/draft-06/schema#", | |
"$ref": "#/definitions/ScanBatch", | |
"definitions": { | |
"ScanBatch": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"version": { | |
"type": "string" |
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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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
#This should be in ebextensions | |
container_commands: | |
01setup_cors: | |
command: "ruby .ebextensions/cors.rb" | |
02reload_nginx: | |
command: "service nginx reload" |
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
class RedisViewCounter | |
attr_reader :object | |
def initialize(object) | |
@object = object | |
end | |
def register_view(fingerprint) | |
created = !$redis.exists(daily_key) |
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
REDIS_A = ConnectionPool.new { Redis.new(:db => 1) } | |
REDIS_B = ConnectionPool.new { Redis.new(:db => 2) } | |
class ShardedWeb < Sidekiq::Web | |
before do | |
desired_shard = params[:shard] || request.cookies['sidekiq_shard'] | |
if desired_shard | |
Thread.current[:sidekiq_via_pool] = Object.const_get(desired_shard) | |
#this prevents us from having to override all links in the web ERBs |
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 'benchmark' | |
module ActiveSupport | |
module Notifications | |
# This is a default queue implementation that ships with Notifications. | |
# It just pushes events to all registered log subscribers. | |
class Fanout | |
def initialize | |
@subscribers = [] | |
@listeners_for = {} | |
@mutex = Mutex.new |
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
define [ | |
'ConsoleFactory' | |
'oraculum/mixins/evented-method' | |
'oraculum/mixins/listener' | |
'select2' | |
], (ConsoleFactory) -> | |
ConsoleFactory.defineMixin 'Select2.ViewMixin', { | |
mixinOptions: |
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
subviews: | |
type_ahead: | |
view: 'AssessmentSearch.View' | |
viewOptions: | |
el: '#assessment_parent_assessment_id' | |
model: 'Model' | |
select2Options: | |
allowClear: true |
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
curl -X DELETE "http://localhost:9200/wildcards/" | |
curl -X POST "http://localhost:9200/wildcards/" -d '{ | |
"mappings": { | |
"post": { | |
properties: { | |
"tags": { | |
"type": "nested", | |
"properties": { | |
"name": {"type": "string"}, | |
"identifier": {"type": "string", "analyzer": "keyword"} |
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
%html | |
%head | |
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"} | |
%title= content_for?(:title) ? yield(:title) : "App_Name" | |
%meta{:content => content_for?(:description) ? yield(:description) : "App_Name", :name => "description"} | |
= stylesheet_link_tag :application, :media => "all" | |
= javascript_include_tag :application | |
= csrf_meta_tags | |
= yield(:head) | |
%body |
NewerOlder