Skip to content

Instantly share code, notes, and snippets.

View Rouhollah's full-sized avatar

Rouhollah Torshizi Rouhollah

View GitHub Profile
@Rouhollah
Rouhollah / direction
Created December 12, 2023 08:41
RTL or LTR for chatGPT site
javascript:(function() { [...document.querySelectorAll("pre")].forEach(ele => ele.style.direction = 'ltr'); [...document.querySelectorAll("p")].forEach(ele => ele.style.direction = ele.style.direction === 'ltr' ? 'rtl' : 'ltr'); })();
@Rouhollah
Rouhollah / recognitionPersiansText.js
Last active March 29, 2023 09:15
recognition of Persians text
You can use the following regular expression to accept only Persian letters:
/^[\u0600-\u06FF\s]+$/
This regular expression accepts Persian letters and spaces. If you want to exclude spaces, you can use:
/^[\u0600-\u06FF]+$/
Here are some examples of how you can use this regular expression in JavaScript:
@Rouhollah
Rouhollah / random color
Last active December 21, 2021 06:07
create random color with javascript - jquery
var color=$(Math.random().toString(16).slice(2, 8).padEnd(6, '0'));
console.log(color.selector);
@Rouhollah
Rouhollah / htmlElementToImage.bat
Created March 5, 2020 09:15
Convert Html Element To Image With Command Line And Google Chrome
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --screenshot=D:\Download\1\screen.png --window-size=1920,1280 --default-background-color=0 C:\Users\r.torshizi\Desktop\flexResponsive.html
@Rouhollah
Rouhollah / css_colors.js
Created May 19, 2019 09:52 — forked from bobspace/css_colors.js
All of the CSS Color names as an array in javascript.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript array containing all of the color names listed in the CSS Spec.
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
var CSS_COLOR_NAMES = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory"
@Rouhollah
Rouhollah / reset.css
Created May 19, 2019 09:52 — forked from StrandGear/reset.css
Modified reset.css to include useful changes from normalize.css
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,