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
int frame_size = 300; | |
long int total = 0; | |
const int NUMBER_OF_LEDS = 6; | |
int leds[NUMBER_OF_LEDS] = {7, 6, 5, 4, 3, 2}; | |
int thresholds[NUMBER_OF_LEDS] = {5, 10, 15, 20, 25, 30}; | |
void setup() { | |
Serial.begin(9600); |
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 PostsController < ApplicationController | |
def index | |
render cell: :index, model: posts | |
end | |
def show | |
post_view_registrar.commit_view | |
show_post_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
class PrimeNumbers | |
include Enumerable | |
def self.prime_numbers_below(edge) | |
new(max_number: edge) | |
end | |
def initialize(max_number:) | |
@max_number = max_number | |
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
MariaDB > SELECT id, summary_rating FROM companies ORDER BY summary_rating DESC; | |
+-------+----------------+ | |
| id | summary_rating | | |
+-------+----------------+ | |
| 75748 | 4.8 | | |
| 61769 | 4.76842 | | |
| 12475 | 4.59091 | | |
| 29849 | 4.54 | | |
+-------+----------------+ |
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
# Concern: | |
module Searchable | |
extend ActiveSupport::Concern | |
included do | |
include Elasticsearch::Model | |
scope :searchable, -> { where(searchable: true) } | |
end | |
module ClassMethods |
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
$ cat test_index.json | |
{ | |
"settings": { | |
"number_of_shards": 1, | |
"analysis": { | |
"analyzer": { | |
"titleAnalyzer": { | |
"tokenizer": "titleTokenizer", | |
"filter": ["lowercase"] | |
} |
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
module Tire | |
module Disable | |
module ClassMethods | |
def mock_es_response_doc | |
@mock_es_response_doc ||= | |
'{"took": 1,"timed_out": false,"_shards": {"total": 5,"successful": 5,"failed": 0},"hits": {"total": 0,"max_score": null,"hits": []}}' | |
end | |
def enable! &blk | |
old_enabled = @tire_enabled || false |
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
[user] | |
name = Dmitry Zhlobo | |
email = [email protected] | |
[alias] | |
co = checkout | |
ci = commit | |
st = status -s | |
br = branch | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
lg = !git --no-pager log --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset [%an]' --abbrev-commit --date=short -20 |
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
# Copyright 2011 Solano Labs All Rights Reserved | |
require 'aruba/api' | |
class CukeGem | |
@setup_done = false | |
class << self | |
include Aruba::Api |
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
# analyzer.rb -- Text Analyzer | |
lines = File.readlines(ARGV.first) | |
line_count = lines.size | |
text = lines.join | |
# Count the characters | |
total_characters = text.length | |
total_characters_nospaces = text.gsub(/\s+/, '').length |