Skip to content

Instantly share code, notes, and snippets.

@Ceda
Ceda / eet.rb
Created November 1, 2017 16:46
EET
require 'eet_cz'
client = EET_CZ::Client.new.tap do |c|
c.endpoint = EET_CZ::PG_EET_URL #EET_CZ::PROD_EET_URL
c.ssl_cert_file = Rails.root.join('EET_CA1_Playground-CZ00000019.p12')
c.ssl_cert_key_file = Rails.root.join('EET_CA1_Playground-CZ00000019.p12')
c.ssl_cert_key_password = 'eet'
c.overovaci_mod = true # It sends attribute: overeni='true' Or explicitly specify 'false'. `default: true`
c.debug_logger = Logger.new('log/eet.log') # or Logger.new($stdout) in tests?
@Ceda
Ceda / translate.py
Last active December 7, 2016 21:28
Translate a yaml file with Yandex Translation API
#!/usr/bin/env python3
import argparse;
import json;
import yaml;
import urllib.parse;
import urllib.request;
##
# Translation URI
@Ceda
Ceda / set_repo_labels.rb
Created October 10, 2016 20:17
Set repo labels
require 'octokit'
Octokit.configure do |c|
c.login = ''
c.password = ''
end
new_labels = [
{ name: 'Blocked', color: 'b60205' },
{ name: 'Bug', color: 'd93f0b' },
@Ceda
Ceda / capybara cheat sheet
Created July 24, 2016 08:45 — forked from iqbalhasnan/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@Ceda
Ceda / Folding (Regular Expressions)
Created July 22, 2014 20:16
Folding (Regular Expressions)
{ foldingStartMarker = '(/\*|\{\s*$)|if\s*\(.*\)';
foldingStopMarker = '(\*/|^\s*\})|endif;';
}
@Ceda
Ceda / zshrc
Created January 24, 2014 17:51
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="steeef"
# Example aliases
@Ceda
Ceda / Greasemonkey cms textarea code highlight.js
Last active August 19, 2020 06:53
Greasemonkey cms textarea code highlight
// ==UserScript==
// @name Blueberry CMS
// @namespace http://blueberry.cz/user/ceda
// @description Highlights the HTML syntax for Textareas in block editor
// @include http://cms.blueberry.cz/*
// @require http://codemirror.net/lib/codemirror.js
// @require http://codemirror.net/addon/fold/foldcode.js
// @require http://codemirror.net/addon/fold/foldgutter.js
// @require http://codemirror.net/addon/fold/xml-fold.js
// @require http://codemirror.net/mode/xml/xml.js
%ul.breadcrumb
%li
%big
="1"
= link_to t('reservations.steps.choose_date_and_count'), root_path
%span.divider
>
%li.active
%big
="2"
@Ceda
Ceda / TMBundle complet
Created October 18, 2013 15:31
Less TMBundle - complete, compile less file if exist style.less as style css else like file.less > file.css accept only css dir
#!/usr/bin/env ruby
filename = File.basename(ENV["TM_FILEPATH"])
if (filename=="style.less")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc -x \"#{file}.less\" > \"#{file}.css\"")
end
# if is modules path
dir, base = File.split(File.dirname(ENV["TM_FILEPATH"]))
@Ceda
Ceda / compile-only-if-style.less
Created October 18, 2013 14:55
TMBundle LESS - compile only if filename is style.less
#!/usr/bin/env ruby
filename = File.basename(ENV["TM_FILEPATH"])
if (filename=="style.less")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc -x \"#{file}.less\" > \"#{file}.css\"")
end