I am trying to make some ASCII art different colors in different sections.
Example the color of the ghosts and the text be different:
<pre>
.-') _ ('-. .-') .-') _
( OO) ) _( OO) ( OO ). ( OO) )
/ '._(,------.(_)---\_)/ '._
|'--...__)| .---'/ _ | |'--...__)
'--. .--'| | \ :` `. '--. .--'
| | (| '--. '..`''.) | |
| | | .--' .-._) \ | |
| | | `---.\ / | |
`--' `------' `-----' `--'
</pre>
Umm.. Since the ghosts' and texts' heights were unequal, that's really hard(merely impossible) to do.
But here's a (semi)solution that's close to your requirements.
Use the combination of linear-gradient and background-clip properties.
Try this
pre{background: -webkit-linear-gradient(blue 44px, red 10%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;}
<pre>
.-') _ ('-. .-') .-') _
( OO) ) _( OO) ( OO ). ( OO) )
/ '._(,------.(_)---\_)/ '._
|'--...__)| .---'/ _ | |'--...__)
'--. .--'| | \ :` `. '--. .--'
| | (| '--. '..`''.) | |
| | | .--' .-._) \ | |
| | | `---.\ / | |
`--' `------' `-----' `--'
</pre>
A codepen: https://codepen.io/Ev1tw1n/pen/NEoxRe
You can consider multiple background and you will be able to easily adjust color of each part of the pre element. You may also consider the em unit so that it will work with any value of font-size:
pre {
background:
linear-gradient(blue, blue) 0 0/5em 5em,
linear-gradient(red, red) 0 100%/5em calc(100% - 5em),
linear-gradient(green, green) 5em 0/10em 3em,
linear-gradient(orange, orange) 5em 100%/10em calc(100% - 3em),
linear-gradient(purple, purple) 15em 0/5em 5em,
linear-gradient(#22eeff, #22eeff) 15em 100%/10em calc(100% - 5em);
background-repeat:no-repeat;
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
}
<pre>
.-') _ ('-. .-') .-') _
( OO) ) _( OO) ( OO ). ( OO) )
/ '._(,------.(_)---\_)/ '._
|'--...__)| .---'/ _ | |'--...__)
'--. .--'| | \ :` `. '--. .--'
| | (| '--. '..`''.) | |
| | | .--' .-._) \ | |
| | | `---.\ / | |
`--' `------' `-----' `--'
</pre>
<pre style="font-size:20px">
.-') _ ('-. .-') .-') _
( OO) ) _( OO) ( OO ). ( OO) )
/ '._(,------.(_)---\_)/ '._
|'--...__)| .---'/ _ | |'--...__)
'--. .--'| | \ :` `. '--. .--'
| | (| '--. '..`''.) | |
| | | .--' .-._) \ | |
| | | `---.\ / | |
`--' `------' `-----' `--'
</pre>
Related
I have sample Data
+----+-----------+
| Id | Name |
+----+-----------+
| 1 | $John |
| 2 | $Carol |
| 3 | $Mike |
| 4 | $Sam |
| 5 | $David$Mohan$ |
6 | $David$
7 | $David$Mohan$
| 8 | Robert$Ram$ |
| 9 | Maxwell$ |
+----+-----------+
I need to remove the only $ first character
Need output :
+----+-----------+
| Id | Name |
+----+-----------+
| 1 | John |
| 2 | Carol |
| 3 | Mike |
| 4 | Sam |
| 5 | David$Mohan |
6 | David
7 | David$Mohan
| 8 | Robert$Ram |
| 9 | Maxwell |
+----+-----------+
Select REPLACE(col,'$','') from Tbl
select regexp_replace(name, '^$', '') name from mytable
I have tried with Replace and Substring but still missing the point .
Can anyone suggest me .
If you are only looking for starting $, you can use this below logic-
DEMO HERE
SELECT
CASE
WHEN LEFT(D,1) = '$' THEN RIGHT(D, LENGTH(D)-1)
ELSE D
END STR,
IF(LEFT(D,1) = '$', RIGHT(D, LENGTH(D)-1), D) STR2
-- you can use any of the above option
FROM
(
select '$David$Mohan$' D UNION ALL
select 'Da$Mo$'
)A
Try this:
select
id,
case when SUBSTR(Name, 1,1)='$' and SUBSTR(Name,-1,1)='$' then substr(Name,2,(length(Name)-2))
when SUBSTR(Name, 1,1)='$' then substr(Name,2)
else Name
end
from Tbl
Based on your example you should try;
Replace(trim(replace({col},'$',' ')), ' ','$')
This is turning the '$' into spaces, removing spaces at the start or end or the string, then switching back to '$'.
Try this, it's working for me for all your test cases
SELECT REGEXP_SUBSTR(name,'[^$].+[^$]') from users;
If case you want to replace $ with space, David$Ang => David Ang
SELECT REGEXP_REPLACE(REGEXP_SUBSTR(name,'[^$].+[^$]'), "[$]", " ") from users;
I am trying to center a table in markdown so i was thinking of putting it inside a div and then text-align the content to center.
<div class="myWrapper" markdown="1">
| Col1 | Col2 | Col3 |
| ------ | ------ | ------ |
| r0 | r0 | r0 |
| r1 | r1 | r1 |
| r2 | r2 | r2 |
| r3 | r3 | r3 |
| r4 | r4 | r4 |
</div>
But doing this will transform it into pure HTML
My question is: How can i use that markdown table inside a div ? And get properly rendered
This answer is aside of the question. I was solving the problem of defining different table styles inside one Markdown document. I'm using Python-Markdown.
The default table stile:
Item No | Name | Description | Price
--------|------|-------------|------
1 | Chair | Kitchen chair | 101.50
2 | Table | Kitchen table | 450.00
The "plated" table style:
<div class="tablePlated"></div>
|Item No | Name | Description | Price|
|--------|------|-------------|------|
|1 | Chair | Kitchen chair | 101.50|
|2 | Table | Kitchen table | 450.00|
And the "gridded" table style:
<div class="tableGridded"></div>
Item No | Name | Description | Price
--------|------|-------------|------
1 | Chair | Kitchen chair | 101.50
2 | Table | Kitchen table | 450.00
Here are the CSS rules:
table {
font-size: 16px;
}
td, th {
padding: 7px 14px;
}
div.tablePlated+table {
border-spacing: 1px;
border-collapse: separate;
}
div.tablePlated+table td, div.tablePlated+table th {
background-color: lightblue;
}
div.tableGridded+table {
border-spacing: 0;
border-collapse: collapse;
}
div.tableGridded+table td, div.tableGridded+table th {
border: solid 1px dodgerblue;
}
And here is the result:
Look at this
Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style emphasis inside an HTML block.
but
Unlike block-level HTML tags, Markdown syntax is processed within span-level tags.
I can't fulltext setting ft_min_word_len because i use web-hosting.
DB Field
hashtag - varchar(256) / utf8_general_ci
DB input value example
| #abc |
| #abc #123 |
| #123 |
| #abc #123 #abcd |
| #1234 |
| #12345 |
I want to search '#123' result
| #abc #123 |
| #123 |
| #abc #123 #abcd |
PHP
$word = $mysqli->real_escape_string($_POST['word']);
mysqli_query($mysqli, "... where (p.hashtag REGEXP '^(.*?(\\\b$word\\\b)[^$]*)$' ) ... ");
I want to more than systax.
add comment
DB Input value more detail
id | title | descript | hastag | viewCnt ...
1 | text1 | text0001 | #123 | 0
2 | text2 | text0002 | #123 #abc | 0
3 | text3 | text0003 | #12345 | 0
...
You should fix your data structure to have a table with one row per hash tag value and id in the table you are using.
But in any case, you can do what you want using like:
select hashtag
from db
where concat(hashtag, '#') like concat('%', $search, '#%');
If you look at the source code of some HTML sites, they use some giant alphabets to comment out or to provide their site name. Something where you write the word and it converts to to HTML like below:
<!--
------
-
---
-
------
!-->
anyone know how to create these types of comments?
Just Google "Big ASCII text art" and you'll find several online generators.
For example, here's one from bigtext.org:
_ _
/ \ __| | __ _ _ __ ___
/ _ \ / _` |/ _` | '_ ` _ \
/ ___ \ (_| | (_| | | | | | |
/_/ \_\__,_|\__,_|_| |_| |_|
Here's another website that lets you customize the font and a few other things. Example (using the font 'tinker-toy'):
O o
/ \ |
o---o o-O oo o-O-o
| || | | | | | |
o o o-o o-o-o o o
Given a string, for example 'imgur', how can I generate large ASCII text like the following? Thanks.
_
(_)
_ _ __ ___ __ _ _ _ _ __
| | '_ ` _ \ / _` | | | | '__|
| | | | | | | (_| | |_| | |
|_|_| |_| |_|\__, |\__,_|_|
__/ |
|___/
You can use ASCII text generator like FIGlet which uses FIGlet fonts. TOIlet is like FIGlet and can use FIGlet fonts but as additional capabilities including Unicode handling, colour fonts, filters and various export formats. Specific logos may need to be created as their own font.
Here are some links:
FIGlet: http://www.figlet.org/
TOIlet: https://apps.ubuntu.com/cat/applications/toilet/
FIGlet fonts: http://www.figlet.org/fontdb.cgi
FIGlet web demo: http://www.kammerl.de/ascii/AsciiSignature.php