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
#!/bin/sh | |
while [ "$#" -gt 0 ]; do | |
case "$1" in | |
-w) width="$2"; shift 2;; | |
-h) height="$2"; shift 2;; | |
-p) filepath="$2"; shift 2;; | |
-m) mask="$2"; shift 2;; | |
--width=*) width="${1#*=}"; shift 1;; |
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
#!/bin/sh | |
while [ "$#" -gt 0 ]; do | |
case "$1" in | |
-s) substr="$2"; shift 2;; | |
-r) replace="$2"; shift 2;; | |
-p) filepath="$2"; shift 2;; | |
--substr=*) substr="${1#*=}"; shift 1;; | |
--replace=*) replace="${1#*=}"; shift 1;; |
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
// For example, if you need to "normalize" viewBox minX, minY to 0, | |
// like this: was viewBox="-270 265 18 32", became viewBox="0 0 18 32" | |
// in this case polygon points should be converted into relative to viewBox values | |
// <polygon points="-268.6,265.8 -268.6,270.8 -258.4,281 -268.6,291.2 -268.6,296.2 -253.4,281" /> | |
// This function will convert those point, it accepts two 3 params: points string, minX and minY | |
// Use example: | |
// var normalizedPlygon = svgPolygonNormalizer("-268.6,265.8 -268.6,270.8 -258.4,281 -268.6,291.2 -268.6,296.2 -253.4,281", -270, 265); | |
// console.log(normalizedPlygon); | |
// > '1.40,0.80 1.40,5.80 11.60,16.00 1.40,26.20 1.40,31.20 16.60,16.00' |
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
const fs = require('fs'); | |
const path = require('path'); | |
function printToHTMLColorMap() { | |
const header = ` | |
<!doctype html> | |
<html> | |
<head> | |
<title>16 lime colors</title> |
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
const fs = require('fs'); | |
const path = require('path'); | |
const dirToParse = 'app/assets/stylesheets/nv'; | |
const skipFile = 'app/assets/stylesheets/nv/shared/colors.scss' | |
const colorRegexp = /(#[A-Z\d]{3}\b|#[A-Z\d]{6}\b)|(rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?([, \.\d]+)?\))/gi; | |
const variableMap = new Map(); | |
const process = require('process'); | |
const args = processArguments(process.argv); | |
var colorMap = new Map(); | |
var fileCounter = 0; |
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
javascript: | |
var fr_pat = /#gh-(\S+): /g; | |
var fr_str = ''; | |
$('.report tr').each(function(i,el) { | |
$td = $(el).find('.text_wrap').eq(3);fr_str += $td.text().replace(fr_pat, '- ') + '\n'; | |
}); | |
console.log(fr_str); |
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 set_ajax_counter(global_var) | |
page.execute_script <<-SCRIPT | |
window["#{global_var}"] = 0; | |
$(document).on("ajaxSend", function(){ | |
window["#{global_var}"]++; | |
console.log('increment ajax counter window["#{global_var}"] = ' + window["#{global_var}"]); | |
}); | |
SCRIPT | |
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
def click_on_day_at_datepicker(date) | |
d = Date.parse(date) | |
month = d.strftime('%b') | |
day = d.day | |
# XPath select Month switcher | |
xpath_month_switcher_selector = '//div[contains(@class, "datepicker-days") and not(contains(@style,"display:none"))]//th[contains(@class, "datepicker-switch")]' | |
find(:xpath, xpath_month_switcher_selector).click | |
# XPath select particular Month | |
xpath_particular_month_selector = "//div[contains(@class, \"datepicker-months\") and not(contains(@style,\"display:none\"))]//*[text() = \"#{month}\"]" | |
find(:xpath, xpath_particular_month_selector).click |
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
javascript: | |
(function (){ | |
var iframe_wrap = document.getElementsByClassName('b-iframe-aplayer')[0], | |
_i = iframe_wrap.getElementsByTagName('iframe')[0], | |
player = _i.contentDocument.getElementById('player'), | |
teasers = _i.contentDocument.getElementsByClassName('b-aplayer-teasers')[0], | |
duration = player.duration; | |
teasers.style.visibility = 'hidden'; | |
player.currentTime = duration; |
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
div#home-store-info { | |
@extend .hidden-xs; | |
@extend .col-sm-12; | |
@extend .col-md-12; | |
margin-bottom: 20px; | |
div.store-info-block { | |
background-color: rgba(255, 255, 255, 0.4); | |
color: #1b6a8e; | |
@extend .row; |
NewerOlder