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
// Run from console on developers tools (chrome dev tools) | |
// Go to friends page from your profile and open console F12 or alt+cmd+I | |
// Get all links from action section, this will fetch links for remove from friends and other too. | |
// FIXME: add filter to show only remove from friends links | |
var l = document.querySelectorAll('.friends_act'); | |
// Function link takes list of links (dom elements) as argument and iterate through each of them and set them style properties | |
// in my case position: fixed; top: 20px; right: 40px; |
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
//<editor-fold desc="Проверка версии IE"> | |
function getInternetExplorerVersion() | |
{ | |
var rv = -1; // Return value assumes failure. | |
if (navigator.appName == 'Microsoft Internet Explorer') | |
{ | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) != null) | |
rv = parseFloat( RegExp.$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
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
// reference http://graphicdesign.stackexchange.com/a/26044/18833 | |
function exportFileToPNG(dest, artBoardIndex) | |
{ | |
var exportOptions = new ExportOptionsPNG24(); // or ExportOptionsPNG24 | |
var type = ExportType.PNG24; // or ExportType.PNG24 | |
var file = new File(dest + ".png"); | |
exportOptions.artBoardClipping = true; | |
exportOptions.antiAliasing = true; |
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
#search for bg images at stylesheets | |
url\(\/assets\/([a-z \/ \. _]+)\) | |
#replace it with image-url rails function | |
image-url('$1') |
NewerOlder