Snippets Collections
ng add @angular/material
import { MatSliderModule } from '@angular/material/slider';

@NgModule ({
  imports: [
    MatSliderModule,
  ]
})
class AppModule {}
<mat-slider min="1" max="100" step="1" value="50"></mat-slider>
git checkout origin/master [filename]
>>> print(f"--- {lambda s: s[::-1]} ---")
  File "<stdin>", line 1
    (lambda s)
             ^
SyntaxError: f-string: invalid syntax

>>> print(f"--- {(lambda s: s[::-1])} ---")
--- <function <lambda> at 0x7f97b775fa60> ---
>>> print(f"--- {(lambda s: s[::-1])('I am a string')} ---")
--- gnirts a ma I ---
SELECT
  (
    `5518_prod`.LF_TIMESTAMP_TRUNC(t0.timestamp, 'MINUTE')
  ) as timestamp,
  COUNTIF(
    f4.status_code <= 99
    OR f4.status_code >= 601
    OR f4.status_code IS NULL
  ) as other,
  COUNTIF(
    f4.status_code BETWEEN 100
    AND 199
  ) as status_1xx,
  COUNTIF(
    f4.status_code BETWEEN 200
    AND 299
  ) as status_2xx,
  COUNTIF(
    f4.status_code BETWEEN 300
    AND 399
  ) as status_3xx,
  COUNTIF(
    f4.status_code BETWEEN 400
    AND 499
  ) as status_4xx,
  COUNTIF(
    f4.status_code BETWEEN 500
    AND 599
  ) as status_5xx,
  COUNT(t0.timestamp) as total
FROM
  `logflare-232118`.5518_prod.05d223cf_10ed_4ae3_8ca6_fba1b93d0ba3 AS t0
  INNER JOIN UNNEST(t0.metadata) AS f1 ON TRUE
  INNER JOIN UNNEST(f1.response) AS f2 ON TRUE
  INNER JOIN UNNEST(t0.metadata) AS f3 ON TRUE
  INNER JOIN UNNEST(f3.response) AS f4 ON TRUE
WHERE
  (
    t0.timestamp >= (
      `5518_prod`.LF_TIMESTAMP_SUB('2021-12-20 07:32:59.865119Z', 120, 'MINUTE')
    )
  )
  AND (f2.status_code = 404)
GROUP BY
  1
ORDER BY
  1 DESC
LIMIT
  120
@Umbraco.GetDictionaryValue("Privatlivspolitik")

@{
    var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
}
@umbracoHelper.GetDictionaryValue("Cookiepolitik")

@(Model.Content.Url.Contains("/en") ? "English" : "Dansk")

// Den her er bedre.
@(Model.Content.AncestorOrSelf(1).GetCulture().ToString() == "en-US" ? "en" : "DK")
<div class="modal-body">
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-4">.col-md-4</div>
      <div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
    </div>
    <div class="row">
      <div class="col-md-3 ml-auto">.col-md-3 .ml-auto</div>
      <div class="col-md-2 ml-auto">.col-md-2 .ml-auto</div>
    </div>
    <div class="row">
      <div class="col-md-6 ml-auto">.col-md-6 .ml-auto</div>
    </div>
    <div class="row">
      <div class="col-sm-9">
        Level 1: .col-sm-9
        <div class="row">
          <div class="col-8 col-sm-6">
            Level 2: .col-8 .col-sm-6
          </div>
          <div class="col-4 col-sm-6">
            Level 2: .col-4 .col-sm-6
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
Combining answers by Petr and Sarfraz, I arrive at the following.

On page1.html in the link:

<a href="page2.html#elementID">Jump</a>
 Save

 On page2.html in the body:

<script type="text/javascript">
    $(document).ready(function() {
        $('html, body').hide();

        if (window.location.hash) {
            setTimeout(function() {
                $('html, body').scrollTop(0).show();
                $('html, body').animate({
                    scrollTop: $(window.location.hash).offset().top
                    }, 1000)
            }, 0);
        }
        else {
            $('html, body').show();
        }
    });
</script>
import itertools
import threading
import time
import sys

def animate_loading(method):
    
    def animated():
        
        done = False
        #here is the animation
        def animate():
            time.sleep(0.000001)
            for c in itertools.cycle(['|', '/', '-', '\\']):
                if done:
                    break
                sys.stdout.write('\rloading ' + c)
                sys.stdout.flush()
                time.sleep(0.1)
            sys.stdout.write('\rDone!     ')
            
        t = threading.Thread(target=animate)
        t.start()

        #process method here
        method()
        done = True
    
    return animated
macro_df.groupby(CELL_NAME).agg({'Bandwidth':'count'})['Bandwidth'].unique()
Here is the list of requirements for the Google IAB testing.

1. AndroidManifest must include "com.android.vending.BILLING" permission.
2. APK is built in release mode.
3. APK is signed with the release certificate(s). (Important: with "App Signing by Google Play" it only works if you download directly from GooglePlayStore!)
4. APK is uploaded to alpha/beta distribution channel (previously - as a draft) to the developer console at least once. (takes some time ~2h-24h).
5. IAB products are published and their status set to active.
6. Test account(s) is added in developer console.


Testing requirements:

1. Test APK has the same versionCode as the one uploaded to developer console.
2. Test APK is signed with the same certificate(s) as the one uploaded to dev.console.
3. Test account (not developer) - is the main account on the device. (Main account might be not necessary - according to @MinosL comment)
4. Test account is opted-in as a tester and it's linked to a valid payment method. 


# Google takes a while to process applications and update them to their servers, for me it takes about half a day. So after saving the apk as a draft on Google Play, you must wait a few hours before the in-app products will respond normally and allow for regular purchases.

# Export and sign APK. Unsigned APK trying to make purchases will get error.
{"response":{"name":"INSTRUMENT_DECLINED","message":"The instrument presented  was either declined by the processor or bank, or it can't be used for this payment.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"f9ac26c7edcc6","httpStatusCode":400},"httpStatusCode":400}
In [3]: idx = df.groupby(['Mt'])['count'].transform(max) == df['count']

In [4]: df[idx]
Out[4]:
    Sp  Mt Value  count
0  MM1  S1     a      3
3  MM2  S3    mk      8
4  MM2  S4    bg     10
8  MM4  S2   uyi      7
# FAST
~/ont-guppy/bin/guppy_basecaller -c dna_r9.4.1_450bps_hac.cfg -i fast5/ -s fastq -x 'auto' --recursive

# High Accuracy
~/ont-guppy/bin/guppy_basecaller -c dna_r9.4.1_450bps_hac.cfg -i fast5/ -s fastq -x 'auto' --recursive --chunks_per_runner 412

# Super High Accuracy
~/ont-guppy/bin/guppy_basecaller -c dna_r9.4.1_450bps_sup.cfg -i fast5/ -s fastq -x 'auto' --recursive
# convert all columns of DataFrame
df = df.apply(pd.to_numeric) # convert all columns of DataFrame

# convert just columns "a" and "b"
df[["a", "b"]] = df[["a", "b"]].apply(pd.to_numeric)
// create an event source
val clicks = EventSource[Unit]

// setup a button to fire events
button <~ On.click(Ui(clicks.fire(())))

// a more useful event stream
val randomInts = clicks.map(_ ⇒ scala.util.Random.nextInt().toString)

// the caption will update with each button click
textView <~ randomInts.map(text)
##First install CUDA
$ sudo apt update -y
$ sudo apt upgrade -y
$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
$ sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
$ wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
$ sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub
$ sudo apt-get -y update
$ sudo apt-get -y install cuda
$ echo "export PATH=/usr/local/cuda-10.2/bin${PATH:+:${PATH}}" >> ~/.bashrc
$ echo "export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> ~/.bashrc
# Creates profile if doesn't exist then edits it
if (!(Test-Path -Path $PROFILE)){ New-Item -Path $PROFILE -ItemType File } ; ise $PROFILE
class SalaryNotInRangeError(Exception):
    """Exception raised for errors in the input salary.

    Attributes:
        salary -- input salary which caused the error
        message -- explanation of the error
    """

    def __init__(self, salary, message="Salary is not in (5000, 15000) range"):
        self.salary = salary
        self.message = message
        super().__init__(self.message)

    def __str__(self):
        return f'{self.salary} -> {self.message}'


salary = int(input("Enter salary amount: "))
if not 5000 < salary < 15000:
    raise SalaryNotInRangeError(salary)
באזור: 
selector .elementor-container {
    flex-wrap: wrap;
}

בכל עמודה:
selector {
    width: 100%;
}

@media (max-width: 767px) {
    selector {
        width: 100%!important;
    }
}
How to Show Seconds in Windows 10 Taskbar Clock
To display seconds in the Windows 10 Taskbar clock, follow these steps:

Start the Registry Editor (regedit.exe)
Go to the following registry branch:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
 Save
In the right-pane, create a DWORD (32-bit) value named ShowSecondsInSystemClock

Double-click ShowSecondsInSystemClock and set its data to 1
Exit the Registry Editor.
Log off and login back in. Or restart the Explorer shell for the change to take effect.

This registry edit works in Windows 10 v1607 and higher — tested up to v20H2.
   - $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
dependencies {
    // Import the BoM for the Firebase platform
    implementation platform('com.google.firebase:firebase-bom:29.0.3')

    // Declare the dependency for the Performance Monitoring library
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-perf'
}
dependencies {
    // Import the BoM for the Firebase platform
    implementation platform('com.google.firebase:firebase-bom:29.0.3')

    // Declare the dependency for the Performance Monitoring library
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-perf-ktx'
}
Accept All Requests
@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\Shell]
@="none"
[HKEY_CLASSES_ROOT\Directory\Shell\Print_Directory_Listing]
@="Print Directory Listing"
[HKEY_CLASSES_ROOT\Directory
hell\Print_Directory_Listing\command]
@="Printdir.bat \"%1\""
[HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory]
"BrowserFlags"=dword:00000008
[HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory
hell\Print_Directory_Listing]
@="Print Directory Listing"
[HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory
hell\Print_Directory_Listing\command]
@="Printdir.bat \"%1\""
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}]
@=""
[HKEY_CLASSES_ROOT\SOFTWARE\Classes\Directory]
"EditFlags"="000001d2"
@media only screen and (min-width: 768px) and (max-width: 1024px) {
.footer h2 {
color: #ffffff;
font-size: 30px;
}
}
@media screen and (max-width: 1024px) {
.footer h2 {
color: #ffffff;
font-size: 30px;
}
}
@media screen and (min-width: 1024px) {
.footer h2 {
color: #ffffff;
font-size: 30px;
}
}
import {HttpClientModule} from '@angular/common/http';
import {APOLLO_OPTIONS} from 'apollo-angular';
import {HttpLink} from 'apollo-angular/http';
import {InMemoryCache} from '@apollo/client/core';

@NgModule({
  imports: [BrowserModule, HttpClientModule],
  providers: [
    {
      provide: APOLLO_OPTIONS,
      useFactory: (httpLink: HttpLink) => {
        return {
          cache: new InMemoryCache(),
          link: httpLink.create({
            uri: 'https://48p1r2roz4.sse.codesandbox.io',
          }),
        };
      },
      deps: [HttpLink],
    },
  ],
})
export class AppModule {}
* {
  margin:0;
  padding:0;
  box-sizing: border-box;
}
body{
  font-family: "Poppins",sans-serif;
}
:root{
   --el-color:#333;

}
h1,
h2,
h3,
h4,
a,
p {
  color: var(--el-color);
}
a{
  text-decoration: none;
}
h1{
  font-size:2.5rem;
}
h2{
  font-size: 2rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 2px;
}
h3{
  font-weight:600;
}
p{
  font-weight: 300;
}
i{
  color:#eb7620;
}
.m-t{
  margin-top: 150px;
}
.m-b {
  margin-bottom: 100px;
}
.container {
  width: 70%;
  margin: auto;
  text-align: center;
}
/* Header Section */
nav{
  height: 100px;
}
nav h2{
  float: left;
  display: inline;
  line-height: 100px;
}
nav ul{
  float: right;
  line-height: 100px;
}
nav ul li{
 display: inline-block;
 margin: 0 25px;
}

nav ul li a {
  text-transform: uppercase;
}

.active{
   background-color: #eb7620;
   border-radius: 20px;
   padding: 7px 25px;
   color:#fff;

}

/* Showcase Area */

.Showcase {
  height: calc(100vh - 100px);
  background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)),
     url("img/mkb\ \(1\).jpg");
  background-size: cover;
  background-repeat: no-repeat;
  border-bottom: 10px solid #eb7620;
}

.Showcase-content h1 {
  color: #fff;
  letter-spacing: 2px;
  
}
.Showcase-content p {
  margin: 50px 0;
  color: #fff;
}
.Showcase-content {
  width: 50%;
  margin: auto;
  text-align: center;
  transform: translateY(30yh);
}
.Showcase-content .btn {
  color: #fff;
  border: 2px solid #fff;
  padding: 10px 60px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: 0.5s all;
}
.Showcase-content .btn:hover {
  background-color: #eb7620;
  border: 0;
}
/* About */
.about .about-image{
  width: 45%;
  float: left;
}
.about-wrapper img {
  max-width: 100%;
  height: auto; 
}
.about .about-content {
  width: 45%;
  float: right;
  text-align: left;
  margin-top: 60px;

}
.about .line{
  width: 15px;
  height: 6px;
  margin-top: 50px;
  background-color: 50px;
}
.about p{
  margin-top: 50px;
}
.about ul{
  margin-top: 50px;
  list-style: none;
}
.about ul li {
  margin: 10px 0;
}
.about.fa-li {
  margin-left: -20px;
}
.social-icon {
  margin-top: 50px;
}
.social-icon i {
  padding: 10px;
  font-size: 30px;
  border: 1px solid black;
}





star

Mon Dec 20 2021 01:27:50 GMT+0000 (Coordinated Universal Time)

@Tazeen

star

Mon Dec 20 2021 01:28:51 GMT+0000 (Coordinated Universal Time)

@Tazeen

star

Mon Dec 20 2021 01:32:16 GMT+0000 (Coordinated Universal Time)

@Tazeen

star

Mon Dec 20 2021 04:05:58 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/37972753/git-reset-single-file-in-feature-branch-to-be-the-same-as-in-master

@exaltzh

star

Mon Dec 20 2021 06:21:56 GMT+0000 (Coordinated Universal Time) https://realpython.com/python-functional-programming/

star

Mon Dec 20 2021 07:34:20 GMT+0000 (Coordinated Universal Time) https://logflare.app/sources/17493/search?querystring

@admariner

star

Mon Dec 20 2021 08:12:51 GMT+0000 (Coordinated Universal Time)

@distance

star

Mon Dec 20 2021 08:15:34 GMT+0000 (Coordinated Universal Time) https://hac20.esp.k12.ar.us/HomeAccess20/Classes/Classwork

@sbrker3

star

Mon Dec 20 2021 14:34:43 GMT+0000 (Coordinated Universal Time) https://medium.com/cleartax-engineering/design-patterns-to-build-ui-components-library-in-react-f547ebbd0e46

star

Mon Dec 20 2021 16:01:25 GMT+0000 (Coordinated Universal Time) https://www.retrostic.com/es/roms/ps-1/resident-evil-3-nemesis-iso-sles-02529-81187/play

@javier

star

Mon Dec 20 2021 21:00:01 GMT+0000 (Coordinated Universal Time) https://coreui.io/docs/components/bootstrap/modal/

@sofiabedoy_96

star

Tue Dec 21 2021 00:18:13 GMT+0000 (Coordinated Universal Time)

@partywave

star

Tue Dec 21 2021 01:22:42 GMT+0000 (Coordinated Universal Time) https://www.paypal.com/mep/dashboard

@zac

star

Tue Dec 21 2021 04:32:24 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/22029562/python-how-to-make-simple-animated-loading-while-process-is-running

star

Tue Dec 21 2021 07:14:11 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/26837998/pandas-replace-nan-with-blank-empty-string

star

Tue Dec 21 2021 07:15:33 GMT+0000 (Coordinated Universal Time) https://www.kite.com/python/answers/how-to-count-unique-values-in-a-pandas-dataframe-group-in-python

star

Tue Dec 21 2021 07:16:30 GMT+0000 (Coordinated Universal Time) https://www.kite.com/python/answers/how-to-count-unique-values-in-a-pandas-dataframe-group-in-python

star

Tue Dec 21 2021 07:52:40 GMT+0000 (Coordinated Universal Time)

@sauravmanu

star

Tue Dec 21 2021 08:53:55 GMT+0000 (Coordinated Universal Time) https://api.programminghub.io/v2/api/paymentIntegration/paypal/returnUrl?validFor

@Samo_Krose

star

Tue Dec 21 2021 09:05:29 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/17071871/how-do-i-select-rows-from-a-dataframe-based-on-column-values

star

Tue Dec 21 2021 09:16:49 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/15705630/get-the-rows-which-have-the-max-value-in-groups-using-groupby

star

Tue Dec 21 2021 15:35:24 GMT+0000 (Coordinated Universal Time) https://id.dreamapply.com/login?client

@chisomloius

star

Tue Dec 21 2021 16:35:54 GMT+0000 (Coordinated Universal Time) https://www.codegrepper.com/code-examples/php/get+base+url+laravel+8

@mvieira

star

Tue Dec 21 2021 21:17:30 GMT+0000 (Coordinated Universal Time) https://hackmd.io/@Miles/rkYKDHPsO

@rezaeir

star

Wed Dec 22 2021 01:55:51 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/15891038/change-column-type-in-pandas

star

Wed Dec 22 2021 06:26:36 GMT+0000 (Coordinated Universal Time) https://47degrees.github.io/macroid/docs/guide/Advanced.html

@LeadingQ

star

Wed Dec 22 2021 07:11:05 GMT+0000 (Coordinated Universal Time) https://linuxtut.com/en/4864ff695d7599491ca8/

@shuvam_deyashi

star

Wed Dec 22 2021 08:45:29 GMT+0000 (Coordinated Universal Time) https://www.techrepublic.com/article/how-to-view-your-ssh-keys-in-linux-macos-and-windows/

@cymoon58

star

Wed Dec 22 2021 08:45:44 GMT+0000 (Coordinated Universal Time) https://www.techrepublic.com/article/how-to-view-your-ssh-keys-in-linux-macos-and-windows/

@cymoon58

star

Wed Dec 22 2021 10:48:19 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/59312671/mock-only-one-function-from-module-but-leave-rest-with-original-functionality

@huttyman

star

Wed Dec 22 2021 11:55:08 GMT+0000 (Coordinated Universal Time) https://hodgkins.io/ultimate-powershell-prompt-and-git-setup

@hankmorelock

star

Wed Dec 22 2021 14:39:14 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/python-programming/user-defined-exception

star

Wed Dec 22 2021 15:39:32 GMT+0000 (Coordinated Universal Time)

@Shesek

star

Wed Dec 22 2021 16:02:30 GMT+0000 (Coordinated Universal Time) https://www.winhelponline.com/blog/show-seconds-taskbar-clock-showsecondsinsystemclock/

@el_pyrolad

star

Wed Dec 22 2021 16:58:45 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/

@cymoon58

star

Wed Dec 22 2021 22:05:53 GMT+0000 (Coordinated Universal Time) https://firebase.google.com/docs/perf-mon/get-started-android

@Behroozkh54

star

Wed Dec 22 2021 22:06:00 GMT+0000 (Coordinated Universal Time) https://firebase.google.com/docs/perf-mon/get-started-android

@Behroozkh54

star

Thu Dec 23 2021 01:28:53 GMT+0000 (Coordinated Universal Time) undefined

@Behroozkh54

star

Thu Dec 23 2021 13:46:17 GMT+0000 (Coordinated Universal Time) https://www.facebook.com/profile.php?id

@JU

star

Thu Dec 23 2021 13:48:45 GMT+0000 (Coordinated Universal Time) https://www.facebook.com/profile.php?id

@JU

star

Thu Dec 23 2021 13:49:34 GMT+0000 (Coordinated Universal Time) https://www.facebook.com/profile.php?id

@JU

star

Thu Dec 23 2021 13:52:17 GMT+0000 (Coordinated Universal Time) https://www.howtogeek.com/howto/windows-vista/create-a-context-menu-item-to-copy-a-list-of-files-to-the-clipboard-in-windows-vista/

@hankmorelock

star

Thu Dec 23 2021 13:56:32 GMT+0000 (Coordinated Universal Time)

@hankmorelock

star

Thu Dec 23 2021 13:58:11 GMT+0000 (Coordinated Universal Time)

@hankmorelock

star

Thu Dec 23 2021 16:38:33 GMT+0000 (Coordinated Universal Time) https://montagne.qodeinteractive.com/landing/?aso

@DanJames196

star

Thu Dec 23 2021 18:50:26 GMT+0000 (Coordinated Universal Time) https://renzobassi.wordpress.com/2018/06/08/assegnare-regole-css-solo-a-determinati-formati-di-monitor/

@renzobassi

star

Thu Dec 23 2021 18:50:54 GMT+0000 (Coordinated Universal Time) https://renzobassi.wordpress.com/2018/06/08/assegnare-regole-css-solo-a-determinati-formati-di-monitor/

@renzobassi

star

Thu Dec 23 2021 18:51:54 GMT+0000 (Coordinated Universal Time) https://renzobassi.wordpress.com/2018/06/08/assegnare-regole-css-solo-a-determinati-formati-di-monitor/

@renzobassi

star

Thu Dec 23 2021 22:02:40 GMT+0000 (Coordinated Universal Time)

@samurab

star

Thu Dec 23 2021 22:22:17 GMT+0000 (Coordinated Universal Time) github.com/developerashed

@developerashed

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension