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
#include <stdio.h> | |
#include <assert.h> | |
#include <stdint.h> | |
uint16_t rgb888torgb565(uint8_t *rgb888Pixel) | |
{ | |
uint8_t red = rgb888Pixel[0]; | |
uint8_t green = rgb888Pixel[1]; | |
uint8_t blue = rgb888Pixel[2]; |
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
before_script: | |
- rbenv local 2.3.0 | |
- gem install bundler --no-ri --no-rdoc | |
- bundle install --jobs $(nproc) "${FLAGS[@]}" | |
stages: | |
- test | |
- deploy | |
test: |
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 panel(heading, options = {}, &block) | |
title = content_tag(:h3, heading, class: 'panel-title') | |
content_tag(:div, | |
content_tag(:div, title, class: 'panel-heading') + | |
content_tag(:div, capture(&block), class: 'panel-body'), | |
options.reverse_merge({class: "panel panel-default"})) | |
end | |
def modal(heading, options = {}, &block) | |
close_button = content_tag(:button, '×'.html_safe, class: 'close', data: { dismiss: 'modal' }) |
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 select_from_chosen(item_text, options) | |
field_name = options[:from] | |
# Find the field | |
field = find_field(field_name, visible: false) | |
# Open the Chosen drop down | |
page.execute_script(%Q!$("##{field[:id]}_chosen").mousedown()!) | |
# Simulate text being typed | |
typed_text = "" | |
item_text.chars.each do |char| |
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' | |
n = 1000000 | |
b = "b string".freeze | |
Benchmark.bmbm do |x| | |
x.report("use interpola") { n.times do; a = 'a string'; "#{a} #{b}"; end} | |
x.report("concat single") { n.times do; a = 'a string'; a + b; end} | |
x.report("use << single") { n.times do; a = 'a string'; a << b; 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
STDOUT.sync = true | |
require 'tdriver' | |
include TDriverVerify | |
puts "Connect SUT" | |
@sut = TDriver.connect_sut(:Id => 'sut_qt') | |
puts "Check dialogfixture" | |
MobyUtil::Parameter[:sut_qt][:fixtures][:dialog] = "dialogfixture" | |
puts "-------------------" |
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 show | |
@company = Company.find(params[:id]) | |
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
get_info.execute.each do |row| | |
res_output = "#{res_output} #{place}: #{row[0]} (#{row[1]});" | |
place += 1 | |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Example double confirm</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('#submit-button').click(function() { | |
var confirm1 = confirm('Are you sure?'); | |
if (confirm1 === true) { |
NewerOlder