text:
List all palindromic prime dates between 0000-01-01 and 99999-12-31
You know what a palindrome, a prime and a date are.

Your task is to list all dates in 100 thousands of years that fulfill
  all three characteristics.

Nevermind anything but the numbers, use the following formats: YYYYMMDD and YYYYYMMDD.
Dates between 0000-01-01 and 9999-12-31 should be printed as 8 digit palindromes dates (If there is any?) and dates between 10000-01-01 and 99999-12-31 should be printed as 9 digit palindromes.
It's not mandatory to list the dates in chronological order.
Example part of valid output.
First three 9 digit prime palindromic dates:
...
100111001
100131001
100161001
...

Rules
Standard loopholes apply.

Rule: 02-29 only exists for years that are divisible by 400 or (divisible by 4 and not divisible by 100).

@user202729 Yeah, I think so, for example I don't think 2017-02-29, 2018-02-29 and 1900-02-29 can be considered "dates".

There aren't any 8-digit palindromic dates that are also primes. Here is a pastebin the list we are supposed to return/print (197 in total). Is this correct @Plarsen?

Should we allow 30th Feb? > https://www.timeanddate.com/date/february-30.html

Year 0000 never happened

@KevinCruijssen Seems correct!

@jrtapsell Yes, but I doubt any of the known ones is both prime and palindromic

Can we just hardcode the output?

@poke Yes, that is one valid way of fulfilling the task

Ruby, 144 141 bytes (134+7 for the -rprime flag)
Saved 3 bytes thanks to benj2240!
('01'..'12').map{|m|('01'..'31').map{|d|(?0..?9).map{|k|q=m+d
y=q.reverse+k
r=y+q
Time.new(y,m,d).day==d.to_i&&r.to_i.prime?&&(p r)}}}

Try it online!
The algorithm:

generate all possible MMDD combinations, from "0101" to "1231"
generate all years for that date that would result in a palindrome, by reversing the MMDD string and adding in the middle, in turn, all chars in the (0..9) range
check if that is a valid date by creating a Time instance with the given y, m, d values. If the resulting time object has a #day value equal to d, then that was a valid date. Otherwise, it would shift the date (for example, Time.new 2018,2,30 returns 2018-03-02).
check if the valid palindrome date is also a prime and display it if it is.

The inner loop was initially a function that was called for each element in the (?0..?9) range, as well as for the empty string.
Since the empty string produced no results (there are no valid 8 digit prime palindromes), I decided to remove it and refactor to this version.

I think you can save a few bytes by removing the t variable: TIO

@benj2240 That's right! Thanks!

Python 2, 116 107 128 122 119 bytes
def g(n=9**8):
 while n<1e9:
  n+=2;m=n/100%100
  if 0<m<13and n%100<31+(m+m/8)%2and`n`[::-1]==`n`and 2**n%n==2:print n

The second half of the 4th line is inspired by mxdsp's answer here to another golf question.
Explanation
The function g() takes an argument only to initialize the n variable using its default value. The initial value is an odd number that's as short as possible and as large as possible while still being less than the first valid answer 100111001.
Loop until n reaches the end of the date range 109. Increment n by 2. m is the month of date n.
If n is a valid date, palindrome and prime, print it:

Date:

0 < m < 13 checks that m is a valid month.
n % 100 < 31 + (m+m/8)%2 checks that n's day of the month is valid. (m+m/8)%2 adds 1 for all months with 31 days. Credit for that goes to ArmanX's answer. There are no primes for February 29-30.

Palindrome: `n`[::-1] == `n`. The backticks stringify n. [::-1] reverses the string.
Prime: 2**n % n == 2 is a Fermat primality test. That test is only probabilistic. There are also non-primes that match. But not in the range of numbers we're looking at.

Nice one using the Fermat’s primality test!

APL (Dyalog Unicode), 155 bytes
⎕CY'dfns'
n←⍕x
m←(⍎2↑¯4↑n)
d←(⍎¯2↑n)
:If n≡⌽n
:AndIf 1 pco x
:AndIf m<13
:AndIf d<32
:If m d≡2 29
:AndIf (400|⍎((≢n)-4)↑n)=0
⎕←x
f x+72
:End
⎕←x
:End
f x+1

Try it online!
This is a Tradfn (traditional function) that takes one argument arg = yyyymmdd or arg = yyyyymmdd. Usage is f arg.
This will not output anything when the argument starts at 10000101 because it doesn't find a prime palindrome date in 60 seconds.
Here is a less golfed approach that will output the OP's example output of
100111001
100131001
100161001

(Try it Online!)
Notice that both codes are the exact same until right before calling the function recursively for the next date. While the golfed version just calls it as f arg+1, the less golfed code jumps from day 31 to day 01 and from month 12 to month 01, which speeds it up quite a bit.
How it works:
⎕CY'dfns'                   ⍝ Copy (⎕CY) all dfns to enable the use of pco.
n←⍕x                        ⍝ Assign (←) the input to the variable n.
m←(⍎2↑¯4↑n)                 ⍝ Take (↑) the last 4 (¯4) elements of n, then take the first 2 elements of that and assign to m.
d←(⍎¯2↑n)                   ⍝ Take the last 2 (¯2) elements of n, and assign to d.
:If n≡⌽n                    ⍝ If n matches (≡) its reverse (⌽) (is a palindrome)
:AndIf 1 pco x              ⍝ And a prime (1 pco)
:AndIf m<13                 ⍝ And month < 13
:AndIf d<32                 ⍝ And day < 32
:If m d≡2 29                ⍝ If it is 2/29
:AndIf (400|⍎((≢n)-4)↑n)=0  ⍝ And the year mod 400 = 0
⎕←x                         ⍝ Print x
f x+72                      ⍝ call f with arg year0301
:End
⎕←x                         ⍝ Print x
:End
f x+1                       ⍝ call f for the next date.

Java 10, 329 327 320 318 312 308 307 264 bytes
v->{for(int y=9999,m,d;++y<1e5;)for(m=0;++m<13;)for(d=0;++d<32;)try{java.time.LocalDate.of(y,m,d);var t=y+"".format("%02d%02d",m,d);long n=new Long(t),x=1;for(;n%++x%n>0;);if(t.contains(new StringBuffer(t).reverse())&n==x)System.out.println(t);}finally{continue;}}

-1 byte thanks to @assylias.
Explanation:
Try it online (note: the prime-checking part has been replaced with a more efficient separated method, although even with that it still times out after 60 seconds, only outputting the first ~115 palindromic prime dates).
Pastebin of all 197 outputs from a local run.
v->{                           // Method without empty unused parameter and no return-type
  for(int y=9999,m,d;++y<1e5;) //  Loop over the years in the range [1000,9999]:
    for(m=0;++m<13;)           //   Inner loop over the months in the range [1,12]:
      for(d=0;++d<32;){        //    Inner loop over the days in the range [1,31]:
        try{java.time.LocalDate.of(y,m,d);
                               //     If it's a valid date:
          var t=y+"".format("%02d%02d",m,d);
                               //      Convert the numbers to a String in format "yyyyyMMdd"
          long n=new Long(t),  //      Convert this String to a long
          x=1;for(;n%++x%n>0;);//      Prime-checking loop
          if(t.contains(new StringBuffer(t).reverse())
                               //      If the string is palindromic
             &n==x)            //      and the long is a prime:
            System.out.println(t);
                               //       Print the string with trailing newline
        }finally{              //     If it isn't a valid date:
          continue;}}}         //      Continue to the next iteration of the inner-most loop

if(t.equals(new StringBuffer(t).reverse()+"") ->
if(t.contains(new StringBuffer(t).reverse()) to save 1 character (works because we know both strings have the same length). That's not much :-(

@assylias Smart, I like it. Thanks! And although 1 byte is not much, it's still 1 byte. Codegolf is always about making it as short as possible, so every byte counts. :)

WolframLanguage (Mathematica) 187 bytes
There may be some reduction in size to be found.
Explanation to follow...
t=ToString;p=PadLeft;d=DateObject;Cases[""<>{t/@p[#,If[Length@#<5,4, 5]],t/@ p[#2,2],t/@p[#3,2]}&@@@(IntegerDigits/@#[[1]]&/@DayRange[d@#,d@#2]),x_/;PalindromeQ@x&&PrimeQ@ToExpression@x]&

Test cases
t = ToString; p = PadLeft; d = DateObject;
Cases["" <> {t /@ p[#, If[Length@# < 5, 4, 5]], t /@ p[#2, 2],
   t /@ p[#3, 2]} & @@@ (IntegerDigits /@ #[[1]] & /@ DayRange[d@#, d@#2]),
   x_ /; PalindromeQ@x && PrimeQ@ToExpression@x] &[{10011, 10, 1}, {10017, 1, 1}]

(*  {"100111001", "100131001", "100161001"}  *)
Explanation of code
DayRange[d@#,d@#2] returns all of the dates between {10011, 10, 1}and {10017, 1, 1}.  In this case, it returns approximately 5 years, 4 months of dates (precisely 1920 dates).  Leap years are taken into account.
The dates are returned in Wolfram-standard formatting.   For example, the first date will appear as DateObject[List[1,1,1],"Day","Gregorian",-5.]`
#[[1]] & /@ will remove the part of the date, in each date, that concerns us.  In the example, DateObject[List[1,3,7],"Day","Gregorian",-5.] returns the abbreviated date, {1,3,7}.
t/@p[#3,2]} or ToString/@Padleft[#3,2] pads the third element, namely, the 7 standing "for 7th day of the month" as "07". Similar padding is provided for the single digit symbol for the month of March, namely, 3 is returned as "03".
p[#, If[Length@# < 5, 4, 5]] pads the year with zeros to reach the length of a 4 or 5 digit string.  In this case, January, namely 1, is returned as `"00001"'.
"" <>... joins the strings.  In this case, it returns "000010307".
Cases[...x_ /; PalindromeQ@x && PrimeQ@ToExpression@x] returns those cases, among the 1920 dates, that are palindromes and primes.

Python 3, 163 bytes
r=range
for m in r(1,13):
 for d in r(1,31+(m%2==(m<8))-2*(m==2)):
  t="%02d"*2%(m,d)
  for i in r(10):x=int(t[::-1]+str(i)+t);all(x%i for i in r(2,x))and print(x)

Solution is fairly long (and probably can get improved upon), but doesn't use any built-in functions for prime/date/palindrome checking. A somewhat ungolfed version for clarity:
for month in range(1,13):
    for day in range(1,31 + (month%2==(month<8)) - 2*(month==2)):
        t = "%02d%02d" % (month, day)
        for i in range(10):
            x = int(t[::-1] + str(i) + t)
            if all(x%i for i in range(2,x)):print(x)

Valid dates are generated by choosing a month and day. As commented before, only size 9 need be considered. Also note that leap years aren't considered. This isn't required because of the lucky coincidence that palindrome primes of length 9 which end on 0229 simply don't exist (other date anomalies like the 30th February of 1712 can be discarded for the same reason).
Next the middle digit is chosen freely, and a prime test is performed. Because of the prime test had to be as short as possible, it is very naive and thus cripplingly slow. Using an external library could solve this (and save some bytes), but as mentioned before I didn't want to use any.

You should make your code look exactly how it does when you counted bytes (in this case by collapsing indent spacing).  Also, it's great that you included an ungolfed version, but usually the golf version is listed first

@wnnmaw The only difference between the version I counted on the one supplied in the answer, is I used tabs instead of the spaces that get used here. As I'm aware tabs get auto-converted, so I don't see any way to fix this.

@Def IIRC Python allows you to use spaces as indentations too, that way it could look the same in your answer too. Correct me if I'm wrong on the first part though.

@elementbound It does indeed, thanks for the suggestion.

Javascript, 187 177
Assumptions: no matching 4 digit years; no matching days in February between 29-30
p=n=>(n<10?'0':'')+n;f=n=>n[3]+n[2]+n[1]+n[0];for(m=13;--m;)for(d=31+(m+(0|m/8))%2;--d;){for(y=10;y--;){z=p(m)+p(d);Y=+(f(z)+y+z);for(i=2;Y%i&&i*i<Y;i++);if(Y%i)console.log(Y)}}

It works like this:
p=n=>(n<10?'0':'')+n;       //Prepend a 0 for 1-digit numbers and convert to a string
f=n=>n[3]+n[2]+n[1]+n[0];   //Flip four digits
for(m=13;--m;)              //Month loop, from 12 to 1
 for(d=
       31+(m+(0|m/8))%2     //Calculate the days in the month, allowing  Feb. 29 & 30
                       ;--d;){ //Day loop
  for(y=10;y--;){           //Middle digit loop
   z=p(m)+p(d);             //Prepend zeros to the month and day
   Y=+(f(z)+y+z);           //Flip the digits; append the middle digit,
                            //month, and day; convert back to an integer
   for(i=2;Y%i&&i*i<Y;i++); //Check if it's a prime
    if(Y%i)console.log(Y)}} //If it doesn't divide evenly, it's not prime. Print it!

History:

187 to 177: There are no prime palindrome dates that fall on Feb. 29 or 30, so we can pretend Feb. has 30 days and save 10 characters.

Notes:
Through testing, I found there are no valid matches that are 4-digit years or fall on Feb. 29 or 30. There are, unfortunately for the sake of the code, exactly five (invalid) results that fall on the 31st of various months that only have 31 days.

VBA, 347
Sub PalindromeDate()
Dim DateString As String
For i = 0 To 9999
    For j = 1 To 12
        For k = 1 To 31
        DateString = Format(i, "0000") & Format(j, "00") & Format(k, "00")
        If DateString = StrReverse(DateString) Then
        Debug.Print DateString
        Else
        End If
        Next k
        Next j
        Next i

End Sub

Welcome to PPCG! I don't know VBA, but it looks like you could golf some whitespace off.

I also don't really know VBA, but I think DateString is an arbitrary variable name, so you should be able to reduce that to a single character, right?

And I think you missed the prime part of "palindromic prime dates".

There would be some code for calculate leap years (the one has February 29 days)

5-digit years are also missing, and Else is not necessary.

Deadfish~, 10529 bytes
{iiiii}dcdcicdciiicdddcicdcic{dddd}ic{iiii}dcdcicdciiiiiicddddddcicdcic{dddd}ic{iiii}icdddcicdciiiiicdddddcicdciiic{dddd}dc{iiii}iiiiic{d}iiicicdcccicdc{i}dddc{dddd}dddddc{iiiii}dddc{d}icicdciiiiiicddddddcicdc{i}dc{ddddd}iiic{iiii}dcccdcicdciccc{dddd}ic{iiii}dcccdciicddciccc{dddd}ic{iiii}dcccdciiiiicdddddciccc{dddd}ic{iiii}dcccdc{i}dddc{d}iiiciccc{dddd}ic{iiii}iiiiicddddddccdciicddcicciiiiiic{dddd}dddddc{iiiii}dddc{d}iiccdc{i}dc{d}icicc{i}ddc{ddddd}iiic{iiii}dcicdcdc{i}ddc{d}iicicicdc{dddd}ic{iiii}iiiiicdddddcdcdciiicdddciciciiiiic{dddd}dddddc{iiii}iiiiicdddddcdcdc{i}ddc{d}iiciciciiiiic{dddd}dddddc{iiiii}dddc{d}iiicdcdciiiiicdddddcicic{i}dddc{ddddd}iiic{iiii}dciicddcdciiicdddciciicddc{dddd}ic{iiii}dcdciicddciiiicddddciicddcic{dddd}ic{iiii}dcdciicddc{i}dddc{d}iiiciicddcic{dddd}ic{iiii}icdddciicddciiicdddciicddciiic{dddd}dc{iiii}icdddciicddc{i}dddc{d}iiiciicddciiic{dddd}dc{iiii}iiiiic{d}iiiciicddcicdciicddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciicddc{i}dddc{d}iiiciicddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciicddc{i}ddc{d}iiciicddc{i}dddc{dddd}dddddc{iiii}dccicddciiicdddciicdcc{dddd}ic{iiii}dccicddciiiiiicddddddciicdcc{dddd}ic{iiii}icddcicddciicddciicdciic{dddd}dc{iiii}icddcicddciiiicddddciicdciic{dddd}dc{iiii}icddcicddciiiiicdddddciicdciic{dddd}dc{iiii}icddcicddc{i}ddc{d}iiciicdciic{dddd}dc{iiii}iiiiicddddddcicddccciicdciiiiiic{dddd}dddddc{iiii}iiiiicddddddcicddciicddciicdciiiiiic{dddd}dddddc{iiii}iiiiicddddddcicddciiicdddciicdciiiiiic{dddd}dddddc{iiii}dciccddciiiicddddciiccdc{dddd}ic{iiii}icdccddciiicdddciiccic{dddd}dc{iiii}icdccddc{i}ddc{d}iiciiccic{dddd}dc{iiii}iiiiicdddddccddciiicdddciicciiiiic{dddd}dddddc{iiii}dcdciiicdddccciiicdddcic{dddd}ic{iiii}dcdciiicdddciiiiiicddddddciiicdddcic{dddd}ic{iiii}icdddciiicdddciiiiicdddddciiicdddciiic{dddd}dc{iiii}iiiiic{d}iiiciiicdddccciiicdddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciiicdddciiiiiicddddddciiicdddc{i}dddc{dddd}dddddc{iiiii}dddc{d}iciiicdddciicddciiicdddc{i}dc{ddddd}iiic{iiii}dcciicdddciiicdddciiicddcc{dddd}ic{iiii}dcciicdddc{i}dc{d}iciiicddcc{dddd}ic{iiii}icddciicdddciicddciiicddciic{dddd}dc{iiii}iiiiicddddddciicdddcicdciiicddciiiiiic{dddd}dddddc{iiii}iiiiicddddddciicdddciiiiiicddddddciiicddciiiiiic{dddd}dddddc{iiii}iiiiicddddddciicdddc{i}dddc{d}iiiciiicddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciicdddciiiiicdddddciiicddc{i}ddc{ddddd}iiic{iiii}icdcicdddc{i}dddc{d}iiiciiicdcic{dddd}dc{iiii}icdcicdddc{i}dc{d}iciiicdcic{dddd}dc{iiii}iiiiicdddddcicdddciicddciiicdciiiiic{dddd}dddddc{iiiii}dddc{d}iiicicdddciiiicddddciiicdc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiicicdddc{i}dddc{d}iiiciiicdc{i}dddc{ddddd}iiic{iiii}dciiccdddciicddciiiccddc{dddd}ic{iiii}dciiccdddciiiiiicddddddciiiccddc{dddd}ic{iiii}dcdciiiicddddccciiiicddddcic{dddd}ic{iiii}dcdciiiicddddciiicdddciiiicddddcic{dddd}ic{iiii}dcdciiiicddddciiiicddddciiiicddddcic{dddd}ic{iiii}icdddciiiicddddciiiiicdddddciiiicddddciiic{dddd}dc{iiii}icdddciiiicddddc{i}dc{d}iciiiicddddciiic{dddd}dc{iiii}iiiiic{d}iiiciiiicddddc{i}dddc{d}iiiciiiicddddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciiiicddddc{i}dc{d}iciiiicddddc{i}dddc{dddd}dddddc{iiiii}dddc{d}iciiiicddddc{i}ddc{d}iiciiiicddddc{i}dc{ddddd}iiic{iiiii}dddc{d}iciiiicddddc{i}dc{d}iciiiicddddc{i}dc{ddddd}iiic{iiii}dcciiicddddciiiicddddciiiicdddcc{dddd}ic{iiii}iiiiicddddddciiicddddciiiicddddciiiicdddciiiiiic{dddd}dddddc{iiii}iiiiicddddddciiicddddc{i}ddc{d}iiciiiicdddciiiiiic{dddd}dddddc{iiii}dciciicddddccciiiicddcdc{dddd}ic{iiii}dciciicddddc{i}ddc{d}iiciiiicddcdc{dddd}ic{iiii}icdciicddddciiiiicdddddciiiicddcic{dddd}dc{iiii}icdciicddddc{i}dddc{d}iiiciiiicddcic{dddd}dc{iiiii}dddc{d}iiiciicddddciicddciiiicddc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiiciicddddc{i}dddc{d}iiiciiiicddc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiiciicddddc{i}ddc{d}iiciiiicddc{i}dddc{ddddd}iiic{iiii}icdddciiiiicdddddc{i}dc{d}iciiiiicdddddciiic{dddd}dc{iiiii}dddc{d}iciiiiicdddddciiicdddciiiiicdddddc{i}dc{ddddd}iiic{iiiii}dddc{d}iciiiiicdddddc{i}dc{d}iciiiiicdddddc{i}dc{ddddd}iiic{iiii}dcciiiicdddddccciiiiicddddcc{dddd}ic{iiii}dcciiiicdddddciicddciiiiicddddcc{dddd}ic{iiii}dcciiiicdddddciiiiiicddddddciiiiicddddcc{dddd}ic{iiii}icddciiiicdddddcicdciiiiicddddciic{dddd}dc{iiii}icddciiiicdddddciiiiicdddddciiiiicddddciic{dddd}dc{iiii}icddciiiicdddddc{i}dddc{d}iiiciiiiicddddciic{dddd}dc{iiii}iiiiicddddddciiiicdddddciiiiicdddddciiiiicddddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciiiicdddddcicdciiiiicddddc{i}ddc{ddddd}iiic{iiiii}dddc{d}iiciiiicdddddciiiiicdddddciiiiicddddc{i}ddc{ddddd}iiic{iiii}dciciiicdddddccciiiiicdddcdc{dddd}ic{iiii}dciciiicdddddcicdciiiiicdddcdc{dddd}ic{iiii}icdciiicdddddciiiiiicddddddciiiiicdddcic{dddd}dc{iiii}icdciiicdddddc{i}ddc{d}iiciiiiicdddcic{dddd}dc{iiii}icdciiicdddddc{i}dc{d}iciiiiicdddcic{dddd}dc{iiii}iiiiicdddddciiicdddddciiiicddddciiiiicdddciiiiic{dddd}dddddc{iiii}dciiciicdddddcicdciiiiicddcddc{dddd}ic{iiii}dciiciicdddddciiiicddddciiiiicddcddc{dddd}ic{iiii}dcdciiiiiicddddddciiiiiicddddddciiiiiicddddddcic{dddd}ic{iiii}icdddciiiiiicddddddc{i}ddc{d}iiciiiiiicddddddciiic{dddd}dc{iiii}dcciiiiicddddddccciiiiiicdddddcc{dddd}ic{iiii}dcciiiiicddddddcicdciiiiiicdddddcc{dddd}ic{iiii}dcciiiiicddddddciiiicddddciiiiiicdddddcc{dddd}ic{iiii}icddciiiiicddddddccciiiiiicdddddciic{dddd}dc{iiii}iiiiicddddddciiiiicddddddciiiicddddciiiiiicdddddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciiiiicddddddccciiiiiicdddddc{i}ddc{ddddd}iiic{iiiii}dddc{d}iiciiiiicddddddciiiiiicddddddciiiiiicdddddc{i}ddc{ddddd}iiic{iiii}iiiiicdddddciiiicddddddciicddciiiiiicddddciiiiic{dddd}dddddc{iiiii}dddc{d}iiiciiiicddddddccciiiiiicddddc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiiciiiicddddddciiiicddddciiiiiicddddc{i}dddc{ddddd}iiic{iiii}dcdc{i}dddc{d}iiiccc{i}dddc{d}iiicic{dddd}ic{iiii}dcdc{i}dddc{d}iiic{i}dddc{d}iiic{i}dddc{d}iiicic{dddd}ic{iiii}icdddc{i}dddc{d}iiiciiiiicdddddc{i}dddc{d}iiiciiic{dddd}dc{iiiii}dddc{d}ic{i}dddc{d}iiiccc{i}dddc{d}iiic{i}dc{ddddd}iiic{iiii}dcciiiiiic{d}iiic{i}dddc{d}iiic{i}dddcddddddcc{dddd}ic{iiii}icddciiiiiic{d}iiiciiiiiicddddddc{i}dddcddddddciic{dddd}dc{iiii}iiiiicddddddciiiiiic{d}iiiciiiiicdddddc{i}dddcddddddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciiiiiic{d}iiiccc{i}dddcddddddc{i}ddc{ddddd}iiic{iiiii}dddc{d}iiciiiiiic{d}iiic{i}dc{d}ic{i}dddcddddddc{i}ddc{ddddd}iiic{iiii}dciciiiiic{d}iiiciiiiiicddddddc{i}dddcdddddcdc{dddd}ic{iiii}dciciiiiic{d}iiic{i}dc{d}ic{i}dddcdddddcdc{dddd}ic{iiii}icdciiiiic{d}iiiciiiiicdddddc{i}dddcdddddcic{dddd}dc{iiii}dciiciiiic{d}iiiciiicdddc{i}dddcddddcddc{dddd}ic{iiii}dciiciiiic{d}iiiciiiicddddc{i}dddcddddcddc{dddd}ic{iiii}dciiciiiic{d}iiiciiiiiicddddddc{i}dddcddddcddc{dddd}ic{iiii}dciiciiiic{d}iiic{i}dc{d}ic{i}dddcddddcddc{dddd}ic{iiii}dcdc{i}ddc{d}iic{i}dddc{d}iiic{i}ddc{d}iicic{dddd}ic{iiii}iiiiic{d}iiic{i}ddc{d}iiciiiicddddc{i}ddc{d}iic{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiic{i}ddc{d}iiciiiiicdddddc{i}ddc{d}iic{i}dddc{dddd}dddddc{iiiii}dddc{d}ic{i}ddc{d}iiccc{i}ddc{d}iic{i}dc{ddddd}iiic{iiiii}dddc{d}ic{i}ddc{d}iiciiiiiicddddddc{i}ddc{d}iic{i}dc{ddddd}iiic{iiiii}dddc{d}ic{i}ddc{d}iic{i}dddc{d}iiic{i}ddc{d}iic{i}dc{ddddd}iiic{iiii}icddc{i}dddc{d}iicicdc{i}ddc{d}iiiciic{dddd}dc{iiii}icddc{i}dddc{d}iiciiiiicdddddc{i}ddc{d}iiiciic{dddd}dc{iiii}icddc{i}dddc{d}iic{i}ddc{d}iic{i}ddc{d}iiiciic{dddd}dc{iiii}iiiiicddddddc{i}dddc{d}iiccc{i}ddc{d}iiiciiiiiic{dddd}dddddc{iiii}iiiiicddddddc{i}dddc{d}iic{i}dc{d}ic{i}ddc{d}iiiciiiiiic{dddd}dddddc{iiiii}dddc{d}iic{i}dddc{d}iiciicddc{i}ddc{d}iiic{i}ddc{ddddd}iiic{iiii}dciciiiiiic{d}iic{i}dddc{d}iiic{i}ddcddddddcdc{dddd}ic{iiii}dciciiiiiic{d}iic{i}dc{d}ic{i}ddcddddddcdc{dddd}ic{iiii}icdciiiiiic{d}iiccc{i}ddcddddddcic{dddd}dc{iiii}icdciiiiiic{d}iiciiicdddc{i}ddcddddddcic{dddd}dc{iiii}iiiiicdddddciiiiiic{d}iiciiicdddc{i}ddcddddddciiiiic{dddd}dddddc{iiiii}dddc{d}iiiciiiiiic{d}iiciicddc{i}ddcddddddc{i}dddc{ddddd}iiic{iiii}dciiciiiiic{d}iiciiiicddddc{i}ddcdddddcddc{dddd}ic{iiii}dcdc{i}dc{d}iccc{i}dc{d}icic{dddd}ic{iiii}icdddc{i}dc{d}icicdc{i}dc{d}iciiic{dddd}dc{iiii}icdddc{i}dc{d}ic{i}dddc{d}iiic{i}dc{d}iciiic{dddd}dc{iiii}icdddc{i}dc{d}ic{i}ddc{d}iic{i}dc{d}iciiic{dddd}dc{iiii}iiiiic{d}iiic{i}dc{d}iciiiiiicddddddc{i}dc{d}ic{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiic{i}dc{d}ic{i}ddc{d}iic{i}dc{d}ic{i}dddc{dddd}dddddc{iiiii}dddc{d}ic{i}dc{d}ic{i}dddc{d}iiic{i}dc{d}ic{i}dc{ddddd}iiic{iiii}dcc{i}ddc{d}icicdc{i}dc{d}iicc{dddd}ic{iiii}icddc{i}ddc{d}iciiiiicdddddc{i}dc{d}iiciic{dddd}dc{iiii}icddc{i}ddc{d}ic{i}dc{d}ic{i}dc{d}iiciic{dddd}dc{iiii}iiiiicddddddc{i}ddc{d}icicdc{i}dc{d}iiciiiiiic{dddd}dddddc{iiiii}dddc{d}iic{i}ddc{d}ic{i}ddc{d}iic{i}dc{d}iic{i}ddc{ddddd}iiic{iiii}dcic{i}dddc{d}ic{i}ddc{d}iic{i}dc{d}iiicdc{dddd}ic{iiii}iiiiicdddddc{i}dddc{d}ic{i}ddc{d}iic{i}dc{d}iiiciiiiic{dddd}dddddc{iiii}dcdccicccdccic{dddd}ic{iiii}dcdcciciicddcdccic{dddd}ic{iiii}dcdcciciiiiicdddddcdccic{dddd}ic{iiii}icdddccicdcicdcciiic{dddd}dc{iiii}icdddcciciiiicddddcdcciiic{dddd}dc{iiii}icdddccic{i}dddc{d}iiicdcciiic{dddd}dc{iiii}dccdcicccdcicc{dddd}ic{iiii}icddcdciciicddcdciciic{dddd}dc{iiii}dcicddcic{i}ddc{d}iicdciicdc{dddd}ic{iiii}icdcddciciiicdddcdciicic{dddd}dc{iiii}icdcddciciiiicddddcdciicic{dddd}dc{iiii}iiiiicdddddcddcicdcicdciiciiiiic{dddd}dddddc{iiiii}dddc{d}iiicddcicccdciic{i}dddc{ddddd}iiic{iiii}dciicdddciciiicdddcdciiicddc{dddd}ic{iiii}dciicdddciciiiiiicddddddcdciiicddc{dddd}ic{iiii}dcdcicciiicdddccdcic{dddd}ic{iiii}dcdcicciiiiiicddddddccdcic{dddd}ic{iiii}icdddcicccccdciiic{dddd}dc{iiii}iiiiic{d}iiicicciiicdddccdc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiicicciiiicddddccdc{i}dddc{dddd}dddddc{iiiii}dddc{d}icicciicddccdc{i}dc{ddddd}iiic{iiii}dcccc{i}dddc{d}iiicccc{dddd}ic{iiii}dcccc{i}ddc{d}iicccc{dddd}ic{iiii}iiiiicddddddccciicddccciiiiiic{dddd}dddddc{iiii}iiiiicddddddccciiiiicdddddccciiiiiic{dddd}dddddc{iiiii}dddc{d}iiccciiiiiicddddddccc{i}ddc{ddddd}iiic{iiii}dcicdcccccicdc{dddd}ic{iiii}dcicdcciicddccicdc{dddd}ic{iiii}dcicdcciiiiicdddddccicdc{dddd}ic{iiii}iiiiicdddddcdcc{i}ddc{d}iicciciiiiic{dddd}dddddc{iiiii}dddc{d}iiicdcc{i}ddc{d}iiccic{i}dddc{ddddd}iiic{iiiii}dddc{d}iciicdciiiicddddcicddc{i}dc{ddddd}iiic{iiiii}dddc{d}iciicdc{i}dddc{d}iiicicddc{i}dc{ddddd}iiic{iiii}dccicdcccicdcc{dddd}ic{iiii}dccicdciiiiicdddddcicdcc{dddd}ic{iiii}dccicdciiiiiicddddddcicdcc{dddd}ic{iiii}iiiiicddddddcicdcccicdciiiiiic{dddd}dddddc{iiii}iiiiicddddddcicdciiiiicdddddcicdciiiiiic{dddd}dddddc{iiiii}dddc{d}iicicdciiiiicdddddcicdc{i}ddc{ddddd}iiic{iiii}icdccdciiiiicdddddciccic{dddd}dc{iiii}dciicdcdc{i}ddc{d}iicicicddc

Clean, 262... 213 bytes
import StdEnv
@ =(rem)
f=[d\\d<-[a*10^4+b*100+c\\a<-[10^4..99999],b<-[1..12],c<-[1..28+[0,3,if(@a 400<1|| @a 4<1&& @a 100>0)1 0,3,2,3,2,3,3,2,3,2,3]!!b]]|(\k=k==reverse k)[p\\p<-:toString d]&&all((<)0o@d)[2..d-1]]

Try it online!

Javascript, 234 229 bytes
A bit bulky, but posting it to get the JS ball rolling. Any suggestions welcome!
f=n=>100+10*n+n/10|0
p=n=>{for(i=2;i<n;n=n%i++<1?0:n);return n>1}
q=n=>(''+(100+n)).slice(-2)
r=_=>{for(m=13;--m;)for(d=32;--d;)for(x=10;--x+1;){s=q(f(d))+q(f(m))+x+q(m)+q(d);if(p(s|0)&&d<(m==2?29:31+(m+m/8|0)%2))console.log(s)}}

Ungolfed:
// Flip a one- or two-digit number
f=n=>100+10*n+n/10|0

// Primality test
// For initial testing, you can replace this line with:
//      p=require('primality')
// This uses the primality npm module and is way faster
p=n=>{for(i=2;i<n;n=n%i++<1?0:n);return n>1}

// Convert number to string, pad with zeroes if necessary
q=n=>(''+(100+n)).slice(-2)

r=_=>{
    // Loop months
    for(m=13;--m;)
        // Loop days
        for(d=32;--d;)
            // Loop middle digit
            for(x=10;--x+1;) {
                // Construct 'date'
                s =
                    // Start with day and month, each flipped
                    q(f(d))+q(f(m)) +
                    // Add middle digit ( will be casted to string since the previous expression is also a string)
                    x +
                    // Add month and date as they are
                    q(m)+q(d);

                if(
                    // Check for primality
                    p(s|0) &&
                    // Check if it's a valid date by validating day ( month and year will always be valid)
                    d<(
                        // For February, we always assume 28 days ( check for 29 because we use less than)
                        m==2?29 :
                        // For other months, it alternates between 31 and 30
                        // EXCEPT July and August both have 31 days, then continues alternating
                        31+(m+m/8|0)%2))
                    console.log(s)
            }
}

How it works:
The digit flipping magic is based mostly on experimenting.
I started by figuring out what number to subtract from to get the flipped version. I only cared about the last two digits.
So, if we take n, find k so that n+k=flip(n). For 10<n<20 k started at 101 and increased in increments of 9. However, for n<10, this was 100. I assumed k increased for every jump of 10, and after a bit of fiddling I figured it was correct.
So, k=100+9*n+n//10 where // means integer division.
Thus, we get n+k = n+(100+9*n+n//10) = 100+10*n+n//10 = flipped(n).
I cannot prove, nor claim that this works for any number, but it produced correct results for the numbers used here.
For the primality test, credit to Kevin Cruijssen's answer. I had a bit shorter version, but I could not get it right:
p=n=>{for(i=n;--i-1;)if(!(n%i))return 1;}

I skipped on the palindrome test, by looping over months, days and a middle digit so I can build strings as dDmMxMmDd, where D is the day's first digit, d is the second, etc.
History
Saved 5 bytes by getting rid of the conditional part of q
q=n=>n<10?'0'+n:(''+n).slice(-2) // from
q=n=>(''+(100+n)).slice(-2)      // to

Sorry for messing around with the byte counts. Slipped in some soft-tabs accidentally. Should be correct now.

You're only ever using f's result as a parameter to q, so cut out the middle man and write f=n=>''+n%10+(n/10|0), and q's result is always used as a string, so you can write q=n=>n<10?'0'+n:n.

APL NARS 626 bytes, 313 chars
f;y;m;d;i;k;v;x;t
t←{60⊥3↑3↓⎕TS}⋄t0←50+t
x←2 12⍴v,v←31 28 31 30 31 30 31 31 30 31 30 31
x[2;2]←29⋄m←d←1⋄y←10000
X:  i←{(0=4∣⍵)∧0≠100∣⍵:1⋄0=400∣⍵:1⋄0}y
A:  →0×⍳y≥1e5
    →0×⍳t≥t0
    k←d+100×m+y×100
    →B×⍳∼k=⍎⌽⍕k⋄→B×⍳∼0πk⋄⎕←k
B:  d+←1
    →A×⍳d≤x[1+i;m]
    d←1⋄→C×⍳∼m=12⋄m←1⋄y+←1⋄→X
C:  m+←1⋄→A

this print what find in 50 second, than stop itself (because otherwise i can not stop
the program for copy paste the test, because i not know how to stop the program without close
the windows of the interpreter)
test:
  f
100111001
100131001
100161001
101030101
101060101
101141101
101171101
102040201
102070201
103000301
103060301
104000401
104030401
104040401

Julia 0.6, 109 bytes
Link goes to a longer version with two differences:

Checks for primes with hand written function, since the Primes package is not available on TIO.
Iterates over a different date range to not time out.

[s for s in Dates.format(Date(0,1,1):Date(100000,1,1),"YYYYmmdd") if Primes.isprime(parse(s))&&s==reverse(s)]

Try it online!


text:
The Non-Zero Digital Product Challenge
Originally the Multiplicative digital root
Challenge
Basically do what the title says
Method
Given a positive integer  1 <= N <= 100000000 through one of our standard input methods, multiply every digit together, ignoring zeroes.
Ex: Take a number, say 361218402:

3 * 6 = 18
18 * 1 = 18
18 * 2 = 36
36 * 1 = 36
36 * 8 = 288
288 * 4 = 1152
1152 * 1 (ignore zeroes or turn them into ones) = 1152
1152 * 2 = 2304

The output for 361218402 is 2304
Note: Treat the digit 0 in numbers as 1.
Test Cases

1 => 1
10 => 1
20 => 2
100 => 1
999 => 729
21333 => 54
17801 => 56
4969279 => 244944
100000000 => 1

Standard Loopholes are disallowed, and this is code-golf, so shortest byte count wins!
Congrats to Jo King who got the bounty with his 70 byte brain-flak answer!

I'd rather call this non-zero digital product. "root" suggests it reduces to a single digit, which isn't always true here.

Can we take input as a string? Or (pushing it) an array of digits?

@EriktheOutgolfer Yes, however, if you repeat the process enough times, it does appear to always go to a single digit.

You can take quoted input, but no, you can't take a pre-parsed list of digits if that's what you're asking

This seems like a variation on the persistence of a number.

If we have to support to a max of 100000000000 I suggest the test case 99999999999 => 31381059609, since it doesn't fit in a default 32-bit integer. Perhaps better would be to lower the maximum output to a 32-bit maximum (2147483647).

Pyt, 3 bytes
ąžΠ

Explanation:
ą       Convert input to array of digits (implicit input as stack is empty)
 ž      Remove all zeroes from the array
  Π     Get the product of the elements of the array

Try it online!

Surprised that this relatively new golfing lang is the only one that appears to be capable of solving this challenge in 3 bytes!

I was surprised by that too!

Haskell, 27 bytes
foldr((*).max 1.read.pure)1

Try it online!
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell

f ∷ String → Int
f = product ∘ map (max 1 ∘ read ∘ pure)

Explanation
I'll start with what I initially had:
product.map(max 1.read.pure)

This is a point-free expression that evaluates to a function taking a string (or a list of characters) s ("301") as an argument. It maps max 1.read.pure over s, essentially taking each character i, injecting it into a list (which makes it a string) (["3", "0", "1"]), then reading it, which evaluates the string ([3, 0, 1]) and finally taking the greater of i and 1 ([3, 1, 1]). Then it takes the product of the resulting list of integers (3).
I then golfed it by a byte with:
foldr((*).max 1.read.pure)1

This works because product is equivalent to foldr (*) 1. Instead of mapping and folding, I combined the two by folding with (*).max 1.read.pure which takes each non-zero digit and multiplies it with the accumulator.

Python 2, 34 bytes
f=lambda n:n<1or(n%10or 1)*f(n/10)

Try it online!

Jelly, 4 bytes
Do1P

Try it online! or see the test suite
How it works
Do1P - Main link. Argument: n (integer)  e.g. 1230456
D    - Digits                                 [1, 2, 3, 0, 4, 5, 6]
 o1  - Replace 0 with 1                       [1, 2, 3, 1, 4, 5, 6]
   P - Product                                720

R, 40 bytes
cat(prod((x=scan()%/%10^(0:12)%%10)+!x))

Try it online!
Since input is guaranteed to have no more than 12 digits, this should work nicely. Computes the digits as x (including leading zeros), then replaces zeros with 1 and computes the product.
cat(					#output
    prod(				#take the product of
         (x=				#set X to
	    scan()			#stdin
		  %/%10^(0:12)%%10)	#integer divide by powers of 10, mod 10, yields digits of the input, with leading zeros. So x is the digits of the input
                                   +!x  #add logical negation, elementwise. !x maps 0->1 and nonzero->0. adding this to x yields 0->1, leaving others unchanged
                                      ))

So this is how to codegolf with R... Nice one ;) Still trying to figure out how this one works though!

@Florian I've added a more verbose explanation.

That's a new way to split digits that I'll have to try!

@BLT that's one of my tips for golfing in R!

C (gcc), 39 bytes
k;f(n){for(k=1;n;n/=10)k*=n%10?:1;k=k;}

Needs to be compiled without optimizations (which is the default setting for gcc, anyway).
Try it online!

That k=k; putting k in the return register accidentally is just plain evil. You should probably add that this only works without optimisations on possibly only x86/x64. +1.

@tomsmeding Somewhat surprisingly, it does work on architectures other than x86. No optimizations (O0) is the default for gcc, so there is no need for explicitly using that flag. I guess I'll add a mention of it to the post anyway.

You might want to specify the exact version of GCC it works with, for future proofing.

@moonheart08 I doubt that it would stop working after some version. Anyway, it works with the latest version, so the time of posting can be used to find a version with which it at least works.

Brain-Flak, 74 72 70 bytes
-2 thanks to Nitrodon for suggesting getting the negation of the number so that you only have to increment rather than decrement later
{([{}]((((()()()){}){}){}){}){({<({}())><>([[]](){})<>}<><{}>)<>}{}}<>

Try it online!
There might be a few ways to golf this further, such as  redoing the multiplication to avoid having to initialise the total with 1. (-2 bytes)
How It Works:
{ Loop over every number
  ([{}]((((()()()){}){}){}){}) Add 48 to the negative of the ASCII to get the negation of the digit
  { If the number is not 0
     ({<({}())><>([[]](){})<>}<><{}>)<> Multiply the total by the number
                                          If the total is on an empty stack, add 1
  }
  {} Pop the excess 0
}<> Switch to the stack with the total

You can golf two more bytes by computing the negation of the actual digit, then counting up to 0 instead of down to 0.

Dang it. I thought with the compression I finally beat a brain-flak answer, but then I ran the same algorithm on yours and got  only 26.25 bytes

@Dadsdy further brain-flak compression can get it down to ~19.81 bytes actually

@JoKing huh. How? I might steal that algorithm and shrink mine down more

@Dadsdy Compressed brain-flak drops it down to 50 bytes, times log_256(9). I'm not sure it's relevant, though perhaps you could replace ()s with a single char

05AB1E, 4 bytes
0KSP

Try it online!
Explanation
0K     # remove zeroes
  S    # split to list of digits
   P   # product

I accepted this answer because it was a four way tie between Jelly, husk, and 05AB1E, and you answered first.

J, 17 14 13 bytes
-4 bytes courtesy of @GalenIvanov
[:*/1>.,.&.":

Try it online!
Probably can be improved some. Edit: and so it was.
Explanation
[: */ 1 >. ,.&.":
                 ": Convert to string
             ,.     Convert row to column vector
               &.   Convert to numbers
      1 >.        Maximum of each element with 1 (convert 0 to 1)
   */              Product
[:                 Cap fork

&.-under is a nifty adverb that applies the verb on the right, then the verb on the left, then the inverse of the verb on the right. Also converting back to numbers is technically using eval (".-do).

You can save a byte by changing +0=] to *#] Try it online

[:*/0-.~,.&.": for 14 bytes. Try it online

@GalenIvanov I knew that signum would be useful! My original thought was (+-.@*), guess I'm inclined to add. I had tried using '0'-.~ assuming an input of a string, not sure why it didn't cross my mind to do it on the split digits. Thanks!

1>. does the job of  0-.~ for a byte less.
[:*/1>.,.&.":
Try it!

Python 2, 43 bytes
lambda n:eval('*'.join(`n`.replace(*'01')))

Try it online!

Octave, 21 bytes
Thanks to @Luis Mendo for saving a byte and thanks to @alephalpha for saving another byte!
@(n)prod((k=n-48)+~k)

Takes input as a string of digits.
Try it online!
30 bytes:
@(n)prod((k=num2str(n)-48)+~k)

Takes input as a number.
Try it online!

@(n)prod((k=n-48)+~k)

Bash + coreutils + sed + bc, 27 24 23 bytes
tr 0 1|sed s/\\B/*/g|bc

Try it online!

JavaScript (ES6), 28 bytes
Designed for 32-bit integers.
f=n=>!n||(n%10||1)*f(n/10|0)

Test cases

f=n=>!n||(n%10||1)*f(n/10|0)

console.log(f(1))        // => 1
console.log(f(10))       // => 1
console.log(f(20))       // => 2
console.log(f(100))      // => 1
console.log(f(999))      // => 729
console.log(f(21333))    // => 54
console.log(f(17801))    // => 56
console.log(f(4969279))  // => 244944

Brachylog, 5 bytes
⊇ẹ×ℕ₁

Try it online!
Explanation
⊇        Take a subset of the input
 ẹ       Split the subset into a list of digits
  ×      Product
   ℕ₁    This product must be in [1, +∞)

This works because ⊇ unifies from large subsets to small subsets, so the first one that will result in a non-zero product is when all zeroes are excluded and nothing else.

Java 8, 55 54 53 51 bytes
int f(int n){return n>0?(n%10>0?n%10:1)*f(n/10):1;}

Port of @Dennis' Python 2 answer.
-1 byte thanks to @RiaD.
Try it here.
55 54 bytes version:
n->{int r=1;for(;n>0;n/=10)r*=n%10>0?n%10:1;return r;}

Try it online.

you can save parens like this: long f(long n){return n>0?(n%10>0?n%10:1)*f(n/10):1;}

Sorry, I'm claiming this one (45 bytes) because the algorithm is totally different ;-)

Perl 5, 23 + 1 (-p) = 24 bytes
$\=1;s/./$\*=$&||1/ge}{

Try it online!

Julia 0.6, 26 bytes
!x=prod(max.(digits(x),1))

Example of use:
julia> !54
20

Try it online!

could you add an example of how to call this, as well as a byte count? you can use TIO!

@Giuseppe oops, I got distracted. I counted the length but didn't add it. Huh TIO supports julia now. Neat.

In fact, TIO supports Julia 0.4-0.6! very nice, +1.

JavaScript (Node.js), 30 bytes
f=([a,...b])=>a?(+a||1)*f(b):1

Try it online!
Takes string as an input, treats it as array, and by array destructuring separates the first element [a,...b]. +a||1 returns digit corresponding to a character. I guess that rest is self explaining..

Vyxal, 3 bytes
fꜝΠ

Try it Online!
Pyt isn't the only language to do 3 bytes :3
Explained
fꜝΠ
f   # flatten to a list
 ꜝ  # remove all 0's
  Π # product

Brain-Flak, 88 bytes
Readable version:
#Push a 1 onto the alternate stack. Return to the main stack
(<>())<>

#While True:
{

    #Push the current digit minus 48 (the ASCII value of '0') onto the alternate stack
    ({}[((((()()()){}){}){}){}]<>)

    #If it's not 0...
    {
        (<

            #Multiply the top two values (the current digit and the current product that started at 1)
            ({}<>)({<({}[()])><>({})<>}{}<><{}>)

        #Also push a 0
        >)

    #Endwhile
    }

    #Pop the 0
    {}

    #Return to the main stack
    <>

#Endwhile
}

#Toggle to the alternate stack, and implicitly display
<>

Try it online!

74 bytes

I literally forgot I posted that comment, and rewrote it from scratch. I'm just going to post separately

Clojure, 56 bytes
(fn[n](apply *(replace{0 1}(map #(-(int %)48)(str n)))))

Pretty basic. Turns the number into a string, then subtracts 48 from each character to turn them back into numbers. It then replaces each 0 with a 1, and applies * to the resulting list of numbers (which reduces * over the list). Can accept a number, or a stringified number.
Try it online!
(defn non-zero-prod [n]
  (let [; Abusing strings to get each digit individually
        str-n (str n)

        ; Then turn them back into numbers
        digits (map #(- (int %) 48) str-n)

        ; Substitute each 0 for a 1
        replaced (replace {0 1} digits)]

    ; Then get the product
    (apply * replaced)))

Ruby, 42 40 35 32 27 bytes
p eval (gets.chars-[?0])*?*

Assumes no newlines in input
Major influence
-2 bytes thanks to @GolfWolf
-5 bytes thanks to @Conor O'Brien

Even shorter than tr: 32 bytes

@GolfWolf Clever :)

Might your perhaps use * to join? p eval (gets.chars-[?0])*?* ?

JavaScript (Node.js), 36 33 bytes
Simple Javascript (ES6) method that takes input as number string, spreads it into an array, then reduces it through multiplication or returns the value if the result is 0.
3 bytes saved thanks to Shaggy
s=>[...s].reduce((a,b)=>b*a||a,1)

Try it online!

Save 3 bytes by taking input as a string.

I don't know why I thought it had to be converted, thanks :D

MATL, 5 bytes
!UXzp

Input is taken as a string
Try it at MATL Online! Or verify test cases in Try It Online!
Explanation
!     % Implicit input: string (row vector of chars). Transpose into
      % a column vector of chars
U     % Convert from string to number. Treats each row independently,
      % producing a column vector of numbers
Xz    % Keep only nonzeros
p     % Product. Implicit display

Befunge, 23 22 bytes
1<*_$#`.#0@#:+!:-"0"~$

Try it online!
Explanation
1<                        Push 1, turn back left, and push a second 1.
                     $    Drop one of them, leaving a single 1, the initial product.

                -"0"~     Read a char and subtract ASCII '0', converting to a number.
             +!:          If it's 0, make it 1 (this is n + !n).
      `  0  :             Then test if it's greater than 0, to check for EOF.
   _                      If it is greater than 0, it wasn't EOF, so we continue left.
  *                       Multiply with the current product, becoming the new product.
1<                        Now we repeat the loop, but this time push only a single 1...
                     $    ...which is immediately dropped, leaving the current product.

   _                      On EOF, the input value will be negative, so we branch right.
    $                     We don't need the input, so drop it.
       .  @               Leaving us with the product, which we output, then exit.

Java (OpenJDK 8), 45 bytes
s->s.chars().reduce(1,(a,b)->b<49?a:a*(b-48))

Try it online!

Ruby + -n, 25 bytes
p eval ($_.chars-[?0])*?*

Try it online!
Ruby (vanilla), 27 bytes
p eval (gets.chars-[?0])*?*

Try it online!

Using ruby -n you can use $_ instead of gets for -2!

@DomHastings Thanks, I'm pretty sure that flag still counts for 1 byte though

I believe the new consensus is Ruby + -n is counted as a different lang without the +1 for -n. Meta

@DomHastings it's a proposal but I'm not going to argue with fewer bytes

C#, 97 Bytes (First code golf)
static int X(int y){var z=y.ToString();int r=1;foreach(var q in z){if(q!=48){r*=q-48;}}return r;}

Not sure if i had to wrap it in a method or not so just included it to be safe.
Takes an Int in, converts it to a string and returns the multiple of each of the characters ignoring 0's. Had to minus 48 due to the program using the ascii value as it reads it as a char.

Welcome to PPCG! I no nothing of C#, but this should help you understand the rules for golfing in it.

Thanks @H.PWiz I really am starting to love these little challenges, definitely making me change my regular programming to be more concise and efficient.

Welcome and nice first try :D Some tips for your answer: you can remove the var z=y.ToString(); and place it directly in the foreach, like so: foreach(var q in y.ToString()); and to get the result you can save more bytes by replacing {if(q!=48){r*=q-48;}} with r*=(q>48?q:1);, shaving off the brackets and the if.

C# (Visual C# Interactive Compiler), 46 bytes
i.Select(c=>c>48?c-48:1).Aggregate((p,c)=>p*c)

Try it online!

Rockstar, 61 bytes
Listen to N
Cut N
O's 1
While N
Let O be*roll N-0 or 1

Say O

Try it (Code will need to be pasted in)

Jelly, 6, 5 bytes
ṢU×\Ṁ

Try it online!

5 mins, not bad!

DTịDP would save a byte, but there are better ways to strip zeroes or replace them with something else.

Multiplicative root with ṢUṀ

Haskell, 36 bytes
f n=product[read[d]|d<-show n,d>'0']

Same byte count:
f n=product[max 1$read[d]|d<-show n]

Try it online!

Also 36

APL (Dyalog), 11 7 bytes
4 bytes saved thanks to @EriktheOutgolfer
×/0~⍨⍎¨

Try it online!

7 bytes (although I doubt you can take the number as a string, but then still 9 bytes)

Python 2, 46 44 bytes
f=lambda n,v=1:n and f(n/10,n%10*v or v)or v

Try it online!
2 bytes thx to Lynn.

f(n/10,n%10*v or v) saves 2 bytes.

><>, 19 bytes
1i:&0(?n&c4*-:0=+*!

Try it online!

Add++, 12 bytes
L,EDBFEZB]B*

Try it online!

Clean, 55 bytes
import StdEnv
@n=prod[toInt c-48\\c<-:toString n|c>'0']

Try it online!

APL+WIN, 9 bytes
×/(⍎¨⎕)~0

Prompts for screen input as a character string, convert to digits, drop zeros and multiply all.

Japt, 5 bytes
ì f ×

Test it here

Explanation
In order: split to an array of digits, filter to remove zeroes and reduce by multiplication.

K (oK), 10 7 bytes
Solution:
*/1|.:'

Try it online!
Example:
*/1|.:'"4969279"
244944

Explanation:
Convert the input string to a list of integers, take max compared to 1 (inspiration from the J solution) and then multiply over the list.
Evaluation is performed right to left.
*/1|.:' / the solution
    .:' / value (.:) each (')
  1|    / or with 1 ( 0=>1, 1=>1, 2=>2 )
*/      / multiply (*) over (/)

Forth (gforth), 62 bytes
: f 1 swap begin ?dup while 10 /mod -rot 1 max * swap repeat ;

Try it online!

Lua, 45 bytes
a=1(...):gsub("[^0]",load("a=a*..."))print(a)

Try it online!

Pyth, 10 9 Bytes
.U*s!BsZs

Try it!
Explanation
.U*s!BsZs
.U        Q     Fold over the implicit input string
      sZ        Convert each char to int
   s!B          Form the list [d,not d] and sum it, so that 0 becomes 1
  *     sb      Multiply by the prev product (implicit). s needed because 1st value is char

JavaScript, 33 32 bytes
Feels like ages since I've done an array mapping solution in JS!
Takes input as a string.
n=>[...n].map(x=>t*=+x||1,t=1)|t

Try it

o.innerText=(f=
n=>[...n].map(x=>t*=+x||1,t=1)|t
)(i.value="361218402");oninput=_=>o.innerText=f(i.value)
<input id=i type=number><pre id=o>

Perl 6, 19 bytes
{[*] grep +*,.comb}

Test it
Expanded:
{  # bare block lambda with implicit parameter ｢$_｣

  [*]        # reduce using &infix:«*»

    grep     # find the values
      +*,    # that aren't "0"
      .comb  # split ｢$_｣ into digits (returns single character strings)
}

Batch, 78 bytes
@set/ap=%2+0,p+=!p,d=%1%%10,p*=d+!d,n=%1/10
@if %1 gtr 0 %0 %n% %p%
@echo %2

Previous 80-byte solution:
@set/an=%1,p=1
:l
@set/ad=n%%10,p*=d+!d,n/=10
@if %n% gtr 0 goto l
@echo %p%

(This version outputs 1 for an input of zero, rather than failing.)

Attache, 20 19 bytes
Prod##Max&1=>Digits

Try it online! Function that takes an integer as an argument and returns an integer.
Explanation
This first takes the Digits of the input number, then each number's Max with 1 is taken, then the Product is taken.
Other solutions
Prod@Larger&1@Digits
Prod@Map[Max&1]@Digits
Prod@Map&:(Max&1)@Digits
{Prod[Max&1=>Digits[_]]}

dc, 40 bytes
Sad to see dc so underrepresented here.
This is essentially my first code golf post, so if I've misjudged how bytes should be counted, go easy on me!  :)
?[1+]sc[10~rdZ1<a]dsax1[rd0=c*z1<b]dsbxp

You can run this in the terminal like so:
$ echo 361218402 | dc -e '?[1+]sc[10~rdZ1<a]dsax1[rd0=c*z1<b]dsbxp'
2304

Or you can try it online!

Explanation (probably too verbose):
? # Read and execute a line from standard input
  # (A number just goes on the stack)
[ # Begin a literal string (ended by a matched ']')
1 # Push 1 onto the stack (when this string is executed as a macro)
+ # Pop top two numbers, add them, push result
] # End literal string
s # Pop top of stack (the string) and store it in...
c # ...register c
[
10 # Push 10 (duh)
~ # Pop top two numbers, divide second popped by first popped, push quotient and then remainder
r # Reverse top two numbers of stack
d # Duplicate top of stack (pop and then push it twice)
Z # Pop top of stack and push its length in digits
1
< # Pop two numbers and compare; if first popped is less than second then...
a # ...run macro stored in register a (a recursive call, here)
] # End string
d # Duplicate top of stack
s # Store in...
a # ...register a
x # Execute the top of stack!
  # At this point the stack will consist of one digit entries, the digits of input
1
[
r # Reverse
d # Duplicate
0
= # If top two numbers are equal then...
c # ...run macro in register c
* # Pop two, multiply, push product
z # Push "height" of stack
1
< # If height of stack is greater than 1 then...
b # ...run macro b
]
d # Duplicate the string on the stack
sb # Store it as macro b
x # Execute!
p # Print top of stack

Always nice to see dc around :) I added a TIO link, hope you don't mind - feel free to rollback if you don't like my edit.

@BMO thanks!  And I don’t know if this is maximally golfed; it’s pretty straightforward implementation.

You might be able to get rid of the first macro and 0=c with this tip, but I haven't tried myself.

Microsoft Excel - 62 47 Bytes
{=PRODUCT(IFERROR(1/(1/MID(A1,ROW(A:A),1)),1))}

Explanation
Converts value in cell A1 to array of digits, changes 0s to 1s using absolute value, then multiplies.
15 bytes saved thanks to Engineer Toast

Save 15 bytes: {=PRODUCT(IFERROR(1/(1/MID(A1,ROW(A:A),1)),1))}. It drops zeroes by trying to divide by them to get an error. You can drop the INDIRECT stuff, too, because dividing by blank text values will also give you an error. All the errors are replaced by 1.

Husk, 4 bytes
ΠfId

Try it online!
ΠfId  -- implicit input N, for example 1607
   d  -- digigts: [1,6,0,7]
 fI   -- filter by identity function: [1,6,7]
Π     -- product: 42

Javascript, 58 bytes
f=a=>{b=1;for(i=0;a[i];i++){(a[i]>0)&&(b=+b*a[i])}alert(b)

Input via function(arg) outputs alert

Red, 68 bytes
func[n][p: 1 while[n > 0][d: n // 10 n: n / 10 if d > 0[p: p * d]]p]

Try it online!
Since 100000000000 is beyond the integer range of the Red language, here's another approach that solves this issue, using string manipulation:
Red, 74 bytes
func[n][p: 1 foreach c to-string n[if c >#"0"[p: p * to-integer c - 48]]p]

Try it online!

Jelly, 4 bytes
Dḟ0P

Try it online!
Dḟ0P    main link

D       int to dec
 ḟ0     filter out 0
   P    product of list

SNOBOL4 (CSNOBOL4), 83 bytes
	DEFINE('O(N)')
O	O =1
R	N LEN(1) . X REM . N	:F(RETURN)
	X =EQ(X) 1
	O =O * X	:(R)

Try it online!
A function that takes input as a string.

Julia 0.6, 33 bytes
x->prod(filter(x->x>0,digits(x)))

Try it online!

Pyth, 7 bytes
*FsMs#Q

Try it online!

*FsMs#Q Full program, takes input in "" from stdin and prints to stdout
    s#Q Filter input for truthiness of int-parse(digit), then
  sM    map int-parse to this,
*F      then fold over multiplication

C# (.NET Core), 78 bytes
using System.Linq

n=>n.Replace("0","").Select(c=>c-'0').Aggregate(1,(a,b)=>a*b)

Try it online!

Smaller is  n=>n.Select(c=>c-'0').Aggregate(1,(a,b)=>a*(b==0?1:b));   You ought to include the terminating ';'

Following @user230118 suggestion, you can shrink it more by replacing '0' with 48, and (b==0?1:b) with (b>0?b:1)

Pari/GP, 34 bytes
n->fold((a,b)->a*(b+!b),digits(n))

Try it online!

Pyth, 6 bytes
*F #sM

Try it Online!
Explanation:
    sM   Get digits of implicit string input
   #     Filter on identity, removing 0s
*F       Fold on multiplication

Pip, 7 bytes
$*YaDC0

Try it online!
Delete Character 0 from the argument a and fold ($) on multiplication (*). The Yank operator is used to adjust the precedence of the subexpression (one byte shorter than $*(aDC0)).

Befunge-98 (PyFunge), 14 bytes
1<*+!:-0'~.j@#

Try it online!

Stax, 4 bytesCP437
┤caü

5 bytes when unpacked,
E0-k*

Run and debug online!
Explanation
E         Convert number to digits
 0-       Remove all zeros
   k*     Reduce array with multiplication

Java 8, 52 bytes
n->(n+"").chars().reduce(1,(x,y)->x*=(y-=48)>0?y:1);

Try it online!

Obligatory stream answer.

Factor + math.extras math.unicode, 21 bytes
[ 48 v-n nonzero Π ]

Attempt This Online!
Takes input as a string and gives output as an integer.

48 v-n Subtract 48 from each code point in the input, converting it to a list of digits.
nonzero Take only the non-zero numbers.
Π Calculate the product of a sequence.

Thunno 2, 3 bytes
0op

Attempt This Online!
Explanation
0op  # Implicit input
0o   # Remove 0s
  p  # Product
     # (Yes, both of those work on numbers)
     # Implicit output

(,), 175 Chars or \$175\log_{256}(3)\approx34.67\$ Bytes
(()()()(),()()()()()()())(()(),())(,((),(())(),,,(()()())(),(())(()()()(),,,,(),,(()()()())))(()(),(()(),,,,(),,(())))((),(,,,,,())),,,(,(()()(),((()))))(()()()),())(,,(()()))

TIO

PHP, 52 Bytes
$t=1;foreach(array_filter(str_split($n))as$b)$t*=$b;

tinylisp, 67 bytes
(load library
(d f(q((N)(i N(*(i(mod N 10)(mod N 10)1)(f(/ N 10)))1

Try it online!
Explanation + ungolfed
The function f computes the non-zero digit product of its argument N. It uses a divmod algorithm to process the digits: If N is nonzero, it computes (N mod 10 if N mod 10 is nonzero, 1 otherwise), and multiplies that quantity by the result of recursing on N divided by 10. Once N becomes zero, all the digits have been processed and we return 1.
(load library)

(def digit-product
 (lambda (num)
  (if num
   (*
    (if (mod num 10) (mod num 10) 1)
    (digit-product (/ num 10)))
   1)))

This implementation commits the cardinal sin of not using tail recursion. It's not a problem for the size of number this challenge requires us to handle, but for big enough numbers, we would eventually hit the max recursion depth. Here's a proper tail-recursive implementation (with helper function) in 83 bytes:
(load library
(d _(q((N P)(i N(_(/ N 10)(*(i(mod N 10)(mod N 10)1)P))P
(q((N)(_ N 1

Try it online!
Ungolfed:
(load library)

(def _digit-product
 (lambda (num accum)
  (if num
   (_digit-product
    (/ num 10)
    (*
     (if (mod num 10) (mod num 10) 1)
     accum))
   accum)))

(lambda (num) (_digit-product num 1))

Arturo, 29 bytes
$=>[∏filter digits&=>[0=&]]

Try it!
$=>[                   ; a function; assign input to &
    ∏                  ; product of...
    filter digits&=>[  ; digits of the input that aren't...
        0=&            ; equal to zero
    ]                  ; end filter
]                      ; end function

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Help my son find his letters
Background
Based on a game my four-year-old got from his rabbi.
The "goal" is to "find" the letters in a given order, e.g. aecdb. You are given a stack of letter cards, e.g. daceb. You can only search through the stack in the order given, albeit cyclically. When you meet a letter you need, you take that out of the stack.
Objective
Given an order and a stack (duplicate-free permutations of each other), find the sequence of top stack letters (it is all printable ASCII) you see while playing the game.
Step-by-step example
We need to find the order aecdb, given the stack daceb:
Top of stack d: Not what we are looking for (a), so we add it to the sequence:d and rotate to get the stack:acebd.
Top of stack a: Yes! so we add it to the sequence:da and remove it from the stack:cebd.
Top of stack c: Not what we are looking for (e), so we add it to the sequence:dac and rotate to get the stack:ebdc.
Top of stack e: Yes! so we add it to the sequence:dace and remove it from the stack:bdc.
Top of stack b: Not what we are looking for (c), so we add it to the sequence:daceb and rotate to get the stack:dcb.
Top of stack d: Not what we are looking for (c), so we add it to the sequence:dacebd and rotate to get the stack:cbd.
Top of stack c: Yes! so we add it to the sequence:dacebdc and remove it from the stack:bd.
Top of stack b: Not what we are looking for (d), so we add it to the sequence:dacebdcb and rotate to get the stack:db.
Top of stack d: Yes! so we add it to the sequence:dacebdcbd and remove it from the stack:b.
Top of stack b: Yes! so we add it to the sequence:dacebdcbdb and remove it from the stack:.
And we are done. The result is dacebdcbdb.
Reference implementation
def letters(target, stack):
    string = ''
    while stack:
        string += stack[0]
        if stack[0] == target[0]:
            stack.pop(0)
            target = target[1:]
        else:
            stack.append(stack.pop(0))
    return string

print letters('aecdb', list('daceb'))

Try it online!
Test cases
try, yrt → yrtyry
1234, 4321 → 4321432434
ABCDEFGHIJKLMNOPQRSTUVWXYZ, RUAHYKCLQZXEMPBWGDIOTVJNSF → RUAHYKCLQZXEMPBWGDIOTVJNSFRUHYKCLQZXEMPWGDIOTVJNSFRUHYKLQZXEMPWGIOTVJNSFRUHYKLQZXMPWGIOTVJNSRUHYKLQZXMPWIOTVJNSRUYKLQZXMPWOTVNSRUYQZXPWOTVSRUYQZXPWTVSRUYQZXWTVSRUYZXWTVSUYZXWTVUYZXWVYZXWYZXYZ
?, ? → ?
 a, a  → a a
abcd, abcd → abcd

APL (Dyalog Classic), 21 bytes
∊⊢,⊢∘⊂~¨(,\⊣⊂⍨1,2>/⍋)

Try it online!
This is a train equivalent to {∊⍵,(⊂⍵)~¨(,\⍺⊂⍨1,2>/⍺⍋⍵)}
⍋ gives the permutation of right argument ⍵ in left argument ⍺
1,2>/ compare consecutive pairs with > and prepend a 1
⍺⊂⍨ use the above boolean mask to split ⍺ into groups; 1s in the mask mark the start of a new group
,\ cumulative concatenations of the groups
(⊂⍵)~¨ complement of each with respect to ⍵
⍵, prepend ⍵
∊ flatten as a single string

Three fairly different methods are giving equal byte counts.
Python 2, 59 bytes
s,t=input()
for c in s*99:
 if c in t:print c;t=t.lstrip(c)

Try it online!
Prints each character in its own line.

Python 2, 59 bytes
lambda s,t:[c==t[0]and t.pop(0)or c for c in s*99if c in t]

Try it online!
Takes lists as input, and outputs a list.

Python 3, 59 bytes
def f(s,t):
 for c in t:p,q=s.split(c);s=q+p;print(end=p+c)

Try it online!

Hm, I'm suspicious of the first two versions...why 99 specifically?

@EriktheOutgolger It's at least the number of printable ASCII characters, and so is at least the length of each input.

JavaScript (ES6), 54 bytes
Takes the target as a string and the stack as an array of characters. Returns a string.
f=(t,[c,...s])=>t&&c+f(t.slice(c==t[0]||!s.push(c)),s)

Test cases

f=(t,[c,...s])=>t&&c+f(t.slice(c==t[0]||!s.push(c)),s)

console.log(f('try',[...'yrt']))
console.log(f('1234',[...'4321']))
console.log(f('aecdb',[...'daceb']))
console.log(f('ABCDEFGHIJKLMNOPQRSTUVWXYZ',[...'RUAHYKCLQZXEMPBWGDIOTVJNSF']))
console.log(f('?',[...'?']))
console.log(f(' a',[...'a ']))
console.log(f('abcd',[...'abcd']))

How?
At each iteration, we extract the character c on the top of the stack and append it to the final result. We then perform a recursive call whose parameters depend on the result of c == t[0], where t[0] is the next expected character.
If c matches t[0]:

we remove c from the target string by passing t.slice(1)
we remove c from the stack by passing s unchanged

If c doesn't match t[0]:

we let the target string unchanged by passing t.slice(0)
we push c back at the end of the stack

Batch, 155 bytes
@set/pt=
@set/ps=
@set r=
:l
@set c=%s:~,1%
@set r=%r%%c%
@if %c%==%t:~,1% set t=%t:~1%&set c=
@set s=%s:~1%%c%
@if not "%t%"=="" goto l
@echo %r%

Takes the target and stack as inputs on STDIN.

Haskell, 49 46 bytes
q@(a:b)#(c:d)|a==c=a:b#d|e<-d++[c]=c:q#e
a#_=a

Try it online!
Fairly simple. Left argument is the "goal" and the right is the stack. If the head of the goal matches the top of the stack we prepend it, and recur with the rest of the goal and the stack (without re-adding the item on top). Otherwise we prepend the top item and recur with the same goal, reading the top item to the end of the stack. When the goal is empty the pattern matching chooses the second line and the empty list is returned.
EDIT: -3 bytes thanks to @GolfWolf and @Laikoni!

47 chars

Also 47

46 bytes

@GolfWolf your second solution (and Laikoni's) doesn't work. It produces "ytrty" instead of "yrtyry" because of operator precedence with (:) and (#)

Python 2, 73 bytes
f=lambda o,s,S='':s and f(o[s[0]==o[0]:],s[1:]+s[:s[0]!=o[0]],S+s[0])or S

Try it online!
I suspect this is very highly golfable.

Python 2, 65 bytes
f=lambda o,s:o and s[0]+f(o[s[0]==o[0]:],s[1:]+s[0]*(s[0]!=o[0]))

Try it online!

Clean, 85 bytes
import StdEnv
g l[u:v][a:b]|a==u=g[a:l]v b=g[a:l][u:v](b++[a])
g l[]_=reverse l
f=g[]

Try it online!
Defines the partial function f taking [Char] and [Char], where the first argument is the target and the second is the stack.

><>, 38 32 bytes
Edit: Teal pelican has a much better ><> approach here that swaps the input methods
0[i:0(1$.
\~~l]1+{$[&
/?=&:&:o:{

Try it online!
Takes the order of the letters through the -s flag, and the stack through input.
How It Works:
0[.... Creates a new empty stack
...... This puts the order of the letters safely away
......

..i:0(1$. Takes input until EOF (-1). This means input is in reverse
..~...    And then teleports to the ~ on this line
......

......      Gets the first character from the beginning of the order
\.~l]1+{$[& And stores it in the register before going to the next line
/.....

......     Output the bottom of the stack
......     Checks if the bottom of the stack is equal to the current character
/?=&:&:o:{ If so, go to the second line, else cycle the stack and repeat

0.....      Pop the extra 0 we collected
\~~l]1+{$[& Pop the value that was equal and get the next character from the order
/.....      And go down to the last line. This will end with an error (which could be avoid with a mere 4 extra bytes

Java 8, 88 bytes
a->b->{for(int c:a)for(char t=0;c!=t;System.out.print(t)){t=b.poll();if(c!=t)b.add(t);}}

Inputs as char[] and java.util.LinkedList<Character> (java.util.Queue implementation)
Explanation:
Try it online.
a->b->{                        // Method with two parameters and no return-type
  for(int c:a)                 //  Loop over the characters of the char-array
    for(char t=0;c!=t;         //   Inner loop until we've found the character in the queue
        System.out.print(t)){  //     After every iteration: print the char `t`
      t=b.poll();              //    Remove the top of the queue, and save it in `t`
      if(c!=t)                 //    If this is not the character we're looking for:
        b.add(t);}}            //     Add it at the end of the queue again

><>, 21 16 bytes
i$\~~
=?\$:{::o@

Try it online!
Flow changed to utilize the empty spaces and remove extra code rerouting. (-5 bytes) - Thanks to @JoKing
><>, 21 bytes
i:{:@=?v:o$!
o~i00. >

Try it online!
The other ><> answer can be found here.
Explanation
The stack starts with an initial set of characters using the -s flag.
Input is the user given character order.
This explanation will follow the flow of the code.
i$\        : Take input, swap the top 2 stack items then move to line 2;
             [1,2,3] -> [1,2,4,3]
  \$:      : Swap the top 2 stack items then duplicate the top item;
             [1,2,4,3] -> [1,2,3,4,4]
     {::o  : Move the stack items 1 left then duplicate the stack top twice and print one;
             [1,2,3,4,4] -> [2,3,4,4,1,1]
=?\      @ : Swap the top three stack items left 1 then do an equal comparison, if equality move to line 1 else continue;
             [2,3,4,4,1,1] -> [2,3,4,1,1,4] -> [2,3,4,1]
  \~~      : Remove the top 2 stack items;
             [2,3,4,1] -> [2,3]

Oh yeah, inputting it that way makes more sense lol

How about 17 bytes?

@JoKing - Very nice change to make those redundant routing go away, I couldn't resist on taking an extra byte off though :P

Perl 5, 42 + 2 (-pl) = 44bytes
for$i(<>=~/./g){/$i/;$\.=$`.$i;$_=$'.$`}}{

Try it online!

Perl, 62 bytes
sub{$_=$_[1];for$x(@{$_[0]}){/\Q$x\E/;$z.="$`$&";$_="$'$`"}$z}

Takes its first argument, the order, as a list of characters and its second, the stack, as a string.
Ungolfed:
sub {
    $_ = $_[1];
    for $x (@{$_[0]}) {
        /\Q$_\E/;
        $z.="$`$&";
        $_ = "$'$`"
    }
    $z
}

You ever wonder what all those obscure regex variables were for? Clearly, they were designed for this exact challenge. We match on the current character $x (which unfortunately has to be escaped in case it's a regex special character). This conveniently splits the string into "before the match" $`, "the match" $&, and "after the match" $'. In the cyclic search, we clearly saw every character before the match and put them back into the stack. We also saw the current character but didn't put it back. So we append "before the match" to the "seen" list $z and construct the stack out of "after the match" followed by "before the match".

SNOBOL4 (CSNOBOL4), 98 bytes
	S =INPUT
	L =INPUT
R	S LEN(1) . X REM . S	:F(END)
	OUTPUT =X
	L POS(0) X =	:S(R)
	S =S X	:(R)
END

Try it online!
Prints each letter on a newline. Use this version to get everything to print on the same line. Takes input as stack, then target, separated by a newline.
	S =INPUT			;*read stack
	L =INPUT			;*read letters
R	S LEN(1) . X REM . S	:F(END)	;*set X to the first letter of S and S to the remainder. If S is empty, goto END.
	OUTPUT =X			;*output X
	L POS(0) X =	:S(R)		;*if the first character of L matches X, remove it and goto R
	S =S X	:(R)			;*else put X at the end of S and goto R
END

Perl, 44 bytes
Includes +4 for -lF
Give input as on STDIN as target then stack (this is the reverse order from the examples):
(echo daceb; echo aecdb) | perl -lF -E '$a=<>;say,$a=~s/^\Q$_//||push@F,$_ for@F'

If you don't mind a trailing newline this 40 works:
(echo daceb; echo aecdb) | perl -plE '$_=<>=~s%.%s/(.*)\Q$&//s;$_.=$1;$&%reg'

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Solve a Rubik's Cube
Your challenge is to write a program to solve a 3x3x3 Rubik's Cube. This challenge is based on this one from 2013, rewritten to adhere to current community standards, and reposted with the original author's permission and help on meta.
Input
The input should represent an unsolved Rubik's Cube.
You may read this input via any standard means, and the input can be in any format you choose, except a sequence of moves to get the cube to an unsolved state (or anything similar); that would trivialize this challenge.
That means that the input can look like this:
    UUU
    UUU
    UUU
 LLLFFFRRRBBB
 LLLFFFRRRBBB
 LLLFFFRRRBBB
    DDD
    DDD
    DDD

U representing cubies on the top/upper face, L representing the left, etc.
It could also look like a Cubically cube-dump, an array of characters/integers, or the weird format in the original challenge; however you like. You must specify how input should be taken in your answer.
You can translate a cube-dump to an ULFRBD scheme here or the other way around here.
Output
You will output, via any allowed means, the moves that must be performed on the inputted Rubik's Cube to return it to the solved state. You may use any chosen notation or method to describe rotation; please specify what you use in your answer.
I recommend that you use Singmaster's notation as it is the simplest and clearest:
R - turn the right face of the cube 90 degrees clockwise
L - turn the left face of the cube 90 degrees clockwise
U - turn the top face of the cube 90 degrees clockwise
D - turn the bottom face of the cube 90 degrees clockwise
F - turn the front face of the cube 90 degrees clockwise
B - turn the back face of the cube 90 degrees clockwise

Append ' to any move to make it counterclockwise and 2 to any move to make it 180 degrees.
If you are unsure of the validity of an I/O method, feel free to comment or ping me in chat.
Examples
Input is in the format of a cube-dump and a ULFRBD layout; output is in Singmaster's notation.
Input -> D'U'R'L'R'L2R'F2U'D'U'D'LR'B'F'U'D'L2R'
Input -> RF2U2R2ULB2R2U2R'L'DB2U2D2B'R'F'B2DFU2RU2L'
Input -> L2FL'R'FB'U2D'F'R'LBF2R2L'F2D2BL2F2RU2D'LF'
Input -> B'U'FURD'B'F'RBF2D'F2R2L2FU'R'U'R2L2F'B2R'F
Input -> R2FUF2D'FR'B'D2L2F'URB2R'U'D'R2L'UD'R2B2UD2
Your program may assume that the given cube is possible to solve; i.e. you do not need to handle the case that the inputted cube is unsolvable.
Restrictions
Answers like this, while valid/interesting on other challenges, are not welcome here. You may not use an algorithm that iterates through every possible state of the cube and prints the moves as it goes, or anything similar.
To define these restrictions, your program must be able to solve each of the test cases above on TIO. So it must:

Exit in under 60 seconds.
Output less than 128KiB.

Validation
To validate that your program indeed solves the Rubik's Cube, you can obviously use a physical cube or an online cube emulator by mixing it how you like, feeding its state into your program, and then performing the output moves on the cube.
However, if you choose to format your input as the cube dump (or the ULFRBD scheme and translate it to a cube dump), you can validate your program via Cubically's online interpreter like so:

Go to the online interpreter.
Type rs into the Code section.
Paste your unsolved cube-dump into the Input section.
Run your program with the unsolved cube-dump. Copy the output into the Footer section.
Click Run. If your program is valid, Solved! will appear in the Output section.

Winning
As this is code-golf, the shortest code in bytes wins!

Sandboxed post.

things I'm assuming: 1. orientation doesn't matter as long as it's solved? 2. the solution does not have to be the shortest possible?

@HyperNeutrino Those assumptions are correct.

@HyperNeutrino If the solution has to be shortest possible, the challenge becomes "implement optimal mode of Cube Explorer".

Under the hood many if not all will perform some move iteration for searching which makes much of the first restriction a do x without y; the time limit and output size restrictions should be enough on their own.

@JonathanAllan Without the first restriction, answers could take millions of years (as the linked one does), which leads to uninteresting and untestable answers.

@MDXF my bad I read it as three restrictions. You said the same thing as my suggestion.

Anyone feel like golfing the DeepCube solution?

@JayCe is there source code?

You can try contacting the authors... I couldn’t find it on Google.

Cubically, 3 bytes
rp▦

Try it online! You can use this to print a random cube.
Explanation:
r    read cube from stdin
 p   set PRINTMOVES flag to display moves as they are performed on the cube
  ▦  insert moves to solve the cube at the current point in the program

Capitalize the P to see prettier output (e.g. RLD'U2 as opposed to R1L1D3U2).

Talk about the right tool for the job.

Have you considered that this is answer is not downvoted due to the trivial content, but because it was posted by the person who asked the question and wrote the programming language four years after the original challenge was posted?

@EngineerToast Four years? How?

@EngineerToast well, I only posted/accepted it since there were no other answers.

I understand that and I hesitated to comment. Waiting 9 days is probably enough. However, it appeared at first glance that the question was asked just to show off what you'd made and - right or wrong thought that may be - I bet it contributed to a poor reception.

Python + kociemba, 27 bytes
A non-trivial language, trivially using the kociemba library
from kociemba import*
solve

Call solve() with a cube in the ULFRBD scheme.
Example, solve('DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD')
 returns u"D2 R' D' F2 B D R2 D2 R' F2 D' F2 U' B2 L2 U2 D R2 U"
(PS, this answer isn't any "better" than the Cubically answer)

I think this is a non-standard library, so you should mention the library name in the language name, for example "Python + kociemba".

Coincidentally the method is exactly the same. / You need to mention the builtin name (meta consensus)

@user202729 actually, not coincidentally.  That link is how I found the library.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Reconstruct My Matryoshka Dolls
Background
A matryoshka doll (or Russian nesting doll) is a set of dolls that fit inside of each other. I've accidentally mixed up my collection of matryoshka dolls and I don't remember which one goes inside which.
Objective
Given a list of unique strings, sort them into nested matryoshka dolls. Each string is an individual doll, and a matryoshka doll is a list of strings.
Rules
Let min(a,b) be the lexicographic min of strings a and b. Let a ⊂ b denote that a is a substring of b. Then,

The list of matryoshka dolls must be sorted lexicographically
String a can fit into string b if a ⊂ b
If a ⊂ b and a ⊂ c, then a will go inside min(b,c)
If both a ⊂ c and b ⊂ c, but a ⊄ b b ⊄ a, then only min(a,b) will go inside c
If both a ⊂ c and b ⊂ c, and also a ⊂ b, then only b will go inside c. I.e., superstrings go before substrings so that the matryoshka isn't prematurely terminated.

Examples
In:
hahaha, hah, lol, lololol, bahaha, bah, haha, ah

Out:
bahaha, bah, ah
hahaha, haha, hah
lololol, lol

In:
aa, aaaa, a, aaaaaaaaaa

Out:
aaaaaaaaaa, aaaa, aa, a

First post here, please point out anything dumb / fixes needed.

Welcome to PPCG! If you're not sure if the post is good enough, you can post it in the Sandbox first.

@user202729, oh I just saw that. Can I move this into sandbox or do I have to delete / add proposal?

It's not mandatory, just keep it here. The community like it.

@sujeet in the future, try to post to the sandbox first. It's a place to get feedback about your challenges before you post them on the main site.  Don't worry about it now, since this challenge seems fine as is, but it's something to consider for the future.

This is a very nice challenge, but it could use a few more test cases.

@Dennis, thanks. I've added another test case. How many do you think I should list?

@sujeet do we need to delimit the matryoshka dolls or can we just return a list of strings? The dolls' positions should be unambiguous without delimiters

@dylnan list of strings is fine — as you say, you can always tell when a new matryoshka begins

What should be the result of ab, ba, aba, bab? By rule 3, both ab and ba should go into aba, and by rule 4, ba cannot go into either aba or bab.

I'm surprised rule 4 doesn't say that max(a,b) goes inside c...

@Zgarb, it should be aba, ab and bab, ba. I agree that the wording of rule 3/4 imply that if they are rejected from both they are just rejected. I did intend for them to be "recirculated".

I suggest that you add some more test cases. For example abc, a, bc

Python 2, 298 bytes
def f(x,E=enumerate):
 o=[]
 while any(x):
	for k,p in E(x):
	 e=0
	 if sum(i(p,j)for j in x)<1:
		for d,r in E(o):
		 if i(p,r[-1])*((r[-1]<e)or e==0):m,e=d,r[-1]
		if e:o[m]+=[p]
		else:o+=[[p]]
		x[k]=''
 print sorted(o)
i=lambda p,b:(b!=p)*any([p==b[j:j+len(p)]for j in range(len(b)-len(p)+1)])

Try it online!
-28 bytes with tips from @dylnan, bug find by @Dennis, and bug fix by @Mr.Xcoder

301 bytes. Just turned i into a lambda function and changed the variable name out to o.

297 bytes (E=enumerate)

Functions have to be reusable, but the out variable never changes. Try it online!

To fix that issue, 298 bytes. Also, out, 3-char variable name... Seriously :P?


text:
Number of leap years between two given years (inclusive)
Is there a better way to calculate the number of leap years between two given years? I want to make my code shorter (in Python). Do you have any suggestions?
Here is my solution:
i=int
r=raw_input
t=i(r())
while t:
 b,d=map(i,r().split())
 c=0
 for y in range(b,d+1):
  if y%400==0 or y%4==0 and y%100:c+=1
 print c
 t-=1

Welcome to PPCG. Would you mind if I edited your post to conform to our standards?

Specifying python is a bit restrictive. Also, you could just say "inclusive" in the title.

Looking at the question, I'm not sure what do you want to ask, as you say "is there a better way" and "in python" so you may want to ask a [tag:tips] question, but I'm not sure. I've VTC as unclear question.

Note to close-voter: this question is on-topic as a tips question, albeit with places for improvement in clarity.

You ask for a way to calculate the number of leap years between two given years, but your code is doing much more than just that. If there are specific input/output formats we have to respect, we have to know about them.

Quick wins (-6 bytes)
Using i=int actually costs 2 bytes, because the shortened expression is only used twice in the code. We can save 4 other bytes by using <1 instead of ==0 and removing useless whitespace.
r=raw_input
t=int(r())
while t:
 b,d=map(int,r().split())
 c=0
 for y in range(b,d+1):
  if y%400<1or y%4<1and y%100:c+=1
 print c
 t-=1

Getting rid of the for loop (-7 bytes)
Using sum(), map() and a lambda is shorter than a for loop with an additional variable. However, we need an explicit test on y%100 to turn the result into a boolean.
r=raw_input
t=int(r())
while t:
 b,d=map(int,r().split())
 print sum(map(lambda y:y%400<1or y%4<1and y%100>0,range(b,d+1)))
 t-=1

Using a built-in function and tweaking the way input is taken (-16 bytes)
Finally, importing and using calendar.isleap saves 7 more bytes. input() instead of int(r()) saves another byte. Dropping r=raw_input and using it directly in the loop saves another 4 bytes. Finally, removing all unnecessary newlines saves 4 bytes too.
from calendar import*
t=input()
while t:b,d=map(int,raw_input().split());print sum(map(isleap,range(b,d+1)));t-=1

Try it online!
Saved 3 bytes thanks to @user202729
Not using a built-in function anymore... (-3 bytes)
t=input()
while t:b,d=map(int,raw_input().split());print sum(y%400<1or y%4<1<=y%100for y in range(b,d+1));t-=1

Try it online!
All these changes have shortened the source code to 110 bytes.

from calendar import* saves 3 more bytes.

@user202729 Thanks! I've turned this into community wiki, so feel free to edit it further.

BTW if the OP says that taking input in the form t \n b, d is allowed, then b,d=input() saves a bunch of bytes