Skip to content

Instantly share code, notes, and snippets.

View webhive's full-sized avatar

Roman Tataurov webhive

View GitHub Profile
@webhive
webhive / rspec_rails_cheetsheet.rb
Created August 8, 2018 09:15 — forked from mlr/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet with expect syntax (including capybara matchers)
# Model
expect(@user).to have(1).error_on(:username) # checks whether there is an error in username
expect(@user.errors[:username]).to include("can't be blank") # check for the error message
# Rendering
expect(response).to render_template(:index)
# Redirecting
@webhive
webhive / custom_board.h
Last active September 15, 2020 07:08
BLE400 custom board file
#ifndef BLE400_H
#define BLE400_H
// LEDs definitions for BLE400
#define LEDS_NUMBER 5
#define LED_START 18
#define LED_1 18
#define LED_2 19
#define LED_3 20
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43d7dee7..7939a767 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,13 +45,13 @@ find_package(Perl REQUIRED)
add_subdirectory(xs)
enable_testing ()
-get_filename_component(PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
-add_test (NAME xs COMMAND "${PERL_EXECUTABLE}" ${PERL_BIN_PATH}/prove -I ${PROJECT_SOURCE_DIR}/local-lib/lib/perl5 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/xs)
@webhive
webhive / Makefile
Created December 24, 2017 17:57
STM8 Standard library patching
CC = sdcc
AR = sdar
CHIP = STM8S003
BUILD_DIR = ./build
SRC_DIR = ./STM8S_StdPeriph_Lib/Libraries/STM8S_StdPeriph_Driver/src
INC_DIR = ./STM8S_StdPeriph_Lib/Libraries/STM8S_StdPeriph_Driver/inc
DIST_DIR = ./$(CHIP)_stdlib
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}\ue0a0 [%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}]"
# Comment
# PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}'
#!/bin/bash
# Install a custom ElasticSearch version - https://www.elastic.co/products/elasticsearch
#
# To run this script in Codeship, add the following
# command to your project's test setup command:
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/elasticsearch.sh | bash -s
#
# Add at least the following environment variables to your project configuration
# (otherwise the defaults below will be used).
# * ELASTICSEARCH_VERSION
@webhive
webhive / Readme.md
Last active January 2, 2016 02:29
Wintersmith benchmark

Measurement

There was a script written for benchmark wintersmith-test.sh.

Result file has columns:

  • Number of posts
  • Generattion time in seconds

Directory structure

@webhive
webhive / Readme.md
Last active April 11, 2017 11:53
Perfomance benchmark of DocPad site generation

Measurement described

  1. docpad run
  2. Selected 'Twitter Bootstrap with Coffeekup' skeleton
  3. Remove docpad-plugin-cleanurl
  4. docpad --env static generate
  5. Recored the time line
  6. Add 100 files to the src/documents/posts directory
  7. Goto #4