Snippets Collections
1.) Maximum subarray size, such that all subarrays of that size have sum less than k: 
-------------------------------------------------------------------------------------
    Given an array of n positive integers and a positive integer k, the task is to find the maximum 	subarray size such that all subarrays of that size have the sum of elements less than k.

    https://www.geeksforgeeks.org/maximum-subarray-size-subarrays-size-sum-less-k/

2.) Find the prime numbers which can written as sum of most consecutive primes: 
-------------------------------------------------------------------------------
    Given an array of limits. For every limit, find the prime number which can be written as the 	 sum of the most consecutive primes smaller than or equal to the limit.
    
    https://www.geeksforgeeks.org/find-prime-number-can-written-sum-consecutive-primes/

3.) Longest Span with same Sum in two Binary arrays : 
-----------------------------------------------------
    Given two binary arrays, arr1[] and arr2[] of the same size n. Find the length of the longest       common span (i, j) where j >= i such that arr1[i] + arr1[i+1] + …. + arr1[j] = arr2[i] +           arr2[i+1] + …. + arr2[j].
    
    https://www.geeksforgeeks.org/longest-span-sum-two-binary-arrays/

3.) Maximum subarray sum modulo m: 
----------------------------------
    Given an array of n elements and an integer m. The task is to find the maximum value of the sum 	of its subarray modulo m i.e find the sum of each subarray mod m and print the maximum value of 	this modulo operation.
    
    https://www.geeksforgeeks.org/maximum-subarray-sum-modulo-m/

4.) Maximum subarray size, such that all subarrays of that size have sum less than k: 
-------------------------------------------------------------------------------------
	Given an array of n positive integers and a positive integer k, the task is to find the maximum 	subarray size such that all subarrays of that size have sum of elements less than k.
    
    https://www.geeksforgeeks.org/maximum-subarray-size-subarrays-size-sum-less-k/

5.) Minimum cost for acquiring all coins with k extra coins allowed with every coin: 
---------------------------------------------------------------------------------
	You are given a list of N coins of different denominations. you can pay an amount equivalent to 	any 1 coin and can acquire that coin. In addition, once you have paid for a coin, we can choose 	at most K more coins and can acquire those for free. The task is to find the minimum amount 	required to acquire all the N coins for a given value of K.

    https://www.geeksforgeeks.org/minimum-cost-for-acquiring-all-coins-with-k-extra-coins-allowed-with-every-coin/
    
6.) Random number generator in arbitrary probability distribution fashion: 
----------------------------------------------------------------------
	Given n numbers, each with some frequency of occurrence. Return a random number with a 			probability proportional to its frequency of occurrence.
    
    https://www.geeksforgeeks.org/random-number-generator-in-arbitrary-probability-distribution-fashion/
import java.util.*;
import java.io.*;

class GFG 
{ 
    static void printFreq(int arr[], int n)
    {
    	int freq = 1, i = 1;

    	while(i < n)
    	{
    		while(i < n && arr[i] == arr[i - 1])
    		{
    			freq++;
    			i++;
    		}

    		System.out.println(arr[i - 1] + " " + freq);

    		i++;
    		freq = 1;
    	}
    }

    public static void main(String args[]) 
    { 
       int arr[] = {10, 10, 20, 30, 30, 30}, n = 6;

       printFreq(arr, n);
    } 
}
class Solution
{
    // String array to store keypad characters
    static String hash[] = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
    
    //Function to find list of all words possible by pressing given numbers.
    static ArrayList <String> possibleWords(int a[], int N)
    {
        String str = "";
        for(int i = 0; i < N; i++)
        str += a[i];
        ArrayList<String> res = possibleWordsUtil(str);
        //arranging all possible strings lexicographically.
        Collections.sort(res); 
        return res;
                    
    }
    
    //recursive function to return all possible words that can
    //be obtained by pressing input numbers.  
    static ArrayList<String> possibleWordsUtil(String str)
    {
        //if str is empty 
        if (str.length() == 0) { 
            ArrayList<String> baseRes = new ArrayList<>(); 
            baseRes.add(""); 
  
            //returning a list containing empty string.
            return baseRes; 
        } 
        
        //storing first character of str
        char ch = str.charAt(0); 
        //storing rest of the characters of str 
        String restStr = str.substring(1); 
  
        //getting all the combination by calling function recursively.
        ArrayList<String> prevRes = possibleWordsUtil(restStr); 
        ArrayList<String> Res = new ArrayList<>(); 
      
        String code = hash[ch - '0']; 
  
        for (String val : prevRes) { 
  
            for (int i = 0; i < code.length(); i++) { 
                Res.add(code.charAt(i) + val); 
            } 
        } 
        //returning the list.
        return Res; 
    }
}
import java.io.*;
import java.util.*;

class Solution {
    public ArrayList<Integer> quadraticRoots(int a, int b, int c) {
        
       ArrayList<Integer> numbers = new ArrayList<Integer>();
       int d = (int) (Math.pow(b,2)-(4*a*c));
       int r1 = (int) Math.floor(((-1*b)+Math.sqrt(d))/(2*a));
       int r2 = (int) Math.floor(((-1*b)-Math.sqrt(d))/(2*a));
       if(d<0){
           numbers.add(-1);
       }
       else
       {
           numbers.add(Math.max(r1,r2));
           numbers.add(Math.min(r1,r2));
       }
       return numbers;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        while (T-- > 0) {
            int a, b, c;
            a = sc.nextInt();
            b = sc.nextInt();
            c = sc.nextInt();
            Solution obj = new Solution();
            ArrayList<Integer> ans = obj.quadraticRoots(a, b, c);
            if (ans.size() == 1 && ans.get(0) == -1)
                System.out.print("Imaginary");
            else
                for (Integer val : ans) System.out.print(val + " ");
            System.out.println();
        }
    }
}
npx create-html5-boilerplate new-site
#!/usr/bin/env bash

# install github-cli
VERSION=`curl  "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-`
echo $VERSION
mkdir ~/downloads
curl -sSL https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz -o ~/downloads/gh_${VERSION}_linux_amd64.tar.gz
cd ~/downloads
tar xvf gh_${VERSION}_linux_amd64.tar.gz
sudo cp gh_${VERSION}_linux_amd64/bin/gh /usr/local/bin/
gh version
sudo cp -r ~/downloads/gh_${VERSION}_linux_amd64/share/man/man1/* /usr/share/man/man1/
# man gh
gh auth login

rm -r ~/downloads
from autoviz.AutoViz_Class import AutoViz_Class

AV = AutoViz_Class()

dft = AV.AutoViz(
    filename="",
    dfte=df,
    lowess=False,
    chart_format="bokeh",
    max_rows_analyzed=150000,
    max_cols_analyzed=30
)
Container(
                                child: Text(
                                  items[index].itemName,
                                  style: TextStyle(
                                      color: Colors.black, fontSize: 30),
                                  textAlign: TextAlign.center,
                                ), //Text
                                height: 40,
                                width: 400,
                                  decoration:
                               BoxDecoration(
                  border: Border.all(color: Colors.black38, width: 3),
                  borderRadius: BorderRadius.circular(20),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.5),
                      spreadRadius: 5,
                      blurRadius: 5,
                      offset: Offset(0, 3), // changes position of shadow
                    ),
                  ],
                  color: Colors.white,
                  image: DecorationImage(
                    image: AssetImage(filterList[index].itemImg),
                    fit: BoxFit.contain,
                  ),
                ),
function multiply(arr, n) {
    if (n <= 0) {
      return 1;
    } else {
      return multiply(arr, n - 1) * arr[n - 1];
    }
  }
Displays a rating bar (likes/dislikes) on the bottom of every YouTube™ video thumbnail.

This extension is open source on GitHub. If you find any bugs or have any suggestions, please open an issue here: https://github.com/elliotwaite/thumbnail-rating-bar-for-youtube

Thanks. Enjoy!

YouTube™ is a trademark of Google LLC. Use of this trademark is subject to Google Permissions.
import unicodedata

def strip_accents(s):
    return ''.join(c for c in unicodedata.normalize('NFD', s)
                   if unicodedata.category(c) != 'Mn')
df = pd.DataFrame({'A': [-3, 7, 4, 0], 'B': [-6, -1, 2, -8], 'C': [1, 2, 3, 4]})

#it goes through column A, selects where it's negative & replaces with 2, or if it's not negative it puts in the values from column C
df.A = np.where(df.A < 0, 2, df.C)


#it goes through column A, selects where it's negative & replaces with 2, or if it's not negative it leaves it as is
df.A = np.where(df.A < 0, 2, df.A)
    var externalDataRetrievedFromServer = [
    { name: 'Bartek', age: 34 },
    { name: 'John', age: 27 },
    { name: 'Elizabeth', age: 30 },
];

function buildTableBody(data, columns) {
    var body = [];

    body.push(columns);

    data.forEach(function(row) {
        var dataRow = [];

        columns.forEach(function(column) {
            dataRow.push(row[column].toString());
        })

        body.push(dataRow);
    });

    return body;
}

function table(data, columns) {
    return {
        table: {
            headerRows: 1,
            body: buildTableBody(data, columns)
        }
    };
}

var dd = {
    content: [
        { text: 'Dynamic parts', style: 'header' },
        table(externalDataRetrievedFromServer, ['name', 'age'])
    ]
}
hasSpecialCharacters = password.contains(new RegExp(r'[!@#$%^&*(),.?":{}|<>]')); 

  final bool isNumeric = password.contains(RegExp('[0-9]'));
  final bool isLowerCase = password.contains(RegExp("(?:[^a-z]*[a-z]){1}"));
  final bool isUpperCase = password.contains(RegExp("(?:[^A-Z]*[A-Z]){1}"));
{ // example 1
   let f = new Intl.DateTimeFormat('en');
   let a = f.formatToParts();
   console.log(a);
}
{ // example 2
   let f = new Intl.DateTimeFormat('hi');
   let a = f.formatToParts();
   console.log(a);
}
/**
* Rewrites text
* @param {String} text The text to rewrite.
* @returns {Promise.<String[]>} Resolves into a list of about 10 rewritten versions. (Or rejects with an error)
* @example 
* var rewritten  = await rewrite("Sometimes I just want to code in JavaScript all day.");
* // ⇒ [
* //    "I sometimes just want to code JavaScript all day.",
* //    "JavaScript is my favorite programming language sometimes.",
* //    "I sometimes wish I could code in JavaScript all day.",
* //    "JavaScript is sometimes all I want to do all day.",
* //    "I like JavaScript sometimes and want to code all day long.",
* //    "Some days I just want to work all day in JavaScript.",
* //    "It's not uncommon for me to just want to code in JavaScript all day.",
* //    "My favorite thing to do sometimes is just code JavaScript all day.",
* //    "My favourite coding language is JavaScript, which I can code all day.",
*//     "JavaScript is my preferred language sometimes, since it lets me code all day.",
*// ];
*/
function rewrite(text) {
  return new Promise(async (resolve, reject) => {
    var { suggestions, error_code, error_msg, error_msg_extra } = await fetch(
      "https://api.wordtune.com/rewrite-limited",
      {
        headers: {
          accept: "*/*",
          "accept-language": "en-US,en;q=0.9",
          "content-type": "application/json",
          "x-wordtune-origin": "https://www.wordtune.com",
        },
        referrer: "https://www.wordtune.com/",
        body: JSON.stringify({
          action: "REWRITE",
          text: text,
          start: 0,
          end: text.length,
          selection: {
            wholeText: text,
            start: 0,
            end: text.length,
          },
        }),
        method: "POST",
      }
    ).then((res) => res.json());
    if (error_code || error_msg || error_msg_extra) {
      reject({
        code: error_code,
        message: error_msg,
        message_extra: error_msg_extra,
      });
    } else {
      resolve(suggestions);
    }
  });
}
<snippet>
    <content><![CDATA[
@mixin ${1:mixtend}(\$extend: true) {
  @if $extend {
    @extend %${1:mixtend};
  } @else {
    ${2}
  }
}

%${1:mixtend} {
  @include ${1:mixtend}(\$extend: false);
}
]]></content>
    <tabTrigger>mixtend</tabTrigger>
    <scope>source.scss</scope>
</snippet>
function destroyer(arr, ...valsToRemove) {
  return arr.filter(elem => !valsToRemove.includes(elem));
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, )

/**
 * Thumbnails option on Post Navigation Elementor widget
 */
add_filter('previous_post_link', 'sydney_child_post_nav_thumbnail', 20, 5 );
add_filter('next_post_link', 'sydney_child_post_nav_thumbnail', 20, 5 );
function sydney_child_post_nav_thumbnail($output, $format, $link, $post, $adjacent) {

	if( !$output ) {
 		return;
  }

  $divclass = '';
  switch ($adjacent) {
		case 'next':
			$divclass = 'custom-nav nav-next';
			break;
		case 'previous':
			$divclass = 'custom-nav nav-previous';
			break;
		default:
			break;
	}

  $arrow_prev = '';
  $arrow_next = '';
  if( 'next' == $adjacent ) {
    $arrow_next = '<span>&#10230;</span>';
  }
  if( 'previous' == $adjacent ) {
    $arrow_prev = '<span>&#10229;</span>';
  }

	$rel   = $adjacent;
  $thumb = get_the_post_thumbnail($post->ID, array( 100, 100));
  $title = '<div class="'.$divclass.'">' . $arrow_prev . $post->post_title . $arrow_next . '</div>';

	$class = '';
	if( !empty($thumb) ) {
		$class = 'post-nav-has-thumbnail';
	}

  $string = '<a href="' . get_permalink( $post->ID ) . '" rel="' . $rel . '" class="'.$class.'">' . $thumb;
  $inlink = str_replace( '%title', $title, $link );
  $inlink = $string . $inlink . '</a>';
  $output = str_replace( '%link', $inlink, $format );

  if( !$post->ID ) {
    return;
  }

  return $output;

}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>

<body>
    <div class="container">
        <div class="coupon-card">
            <img src="google.png" alt="" class="logo">
            <h3>20% Flat off on all ride with in the city using <br> HDFC Credit Card </h>

                <div class="coupon-row">
                    <span id="cpncode">STEALDEAL20</span>
                    <span id="cpnbtn">Copy CODE</span>
                </div>
                <p>Valid Till:20-11-2022</p>
                <div class="circle1"></div>
                <div class="circle2"></div>

        </div>
    </div>
    <script>
        var cpnbtn = document.getElementById("cpnbtn")
        var cpncode = document.getElementById("cpncode")
        
        
        cpnbtn.onclick = function(){
            navigator.clipboard.writeText(cpncode.innerHTML);
            cpnbtn.innerHTML = "COPIED";
            setTimeout(function(){
                cpnbtn.innerHTML = "COPY";
        
            }, 3000); 
        }
    </script>
</body>

</html>
// demo is a class that is needed anyway and then boxASelected is added if true
:class="{active: boxASelected}"

// Or pass this into a computed property
:class="{boxAClasses}"

computed: {
  boxAClasses() {
    return { active: this.boxASelected };
  }
}
yarn typopack build watch

eval $(ssh-agent -s)

yarn dep deploy 
yarn dep deploy production
(function(){/*

SPF
(c) 2012-2017 Google Inc.
https://ajax.googleapis.com/ajax/libs/spf/2.4.0/LICENSE
*/
var l="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function aa(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n&&n];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var p=aa(this);
function r(a,b){if(b)a:{var c=p;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&l(c,a,{configurable:!0,writable:!0,value:b})}}function ba(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}
r("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,h){this.h=f;l(this,"description",{configurable:!0,writable:!0,value:h})}if(a)return a;c.prototype.toString=function(){return this.h};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
r("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=p[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&l(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ca(ba(this))}})}return a});function ca(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
function da(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}r("Array.prototype.keys",function(a){return a?a:function(){return da(this,function(b){return b})}});/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
function u(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var e=d.slice();e.push.apply(e,arguments);return a.apply(b,e)}}function ea(a,b){if(a){var c=Array.prototype.slice.call(arguments,1);try{return a.apply(null,c)}catch(d){return d}}}var v=window.performance&&window.performance.timing&&window.performance.now?function(){return window.performance.timing.navigationStart+window.performance.now()}:function(){return(new Date).getTime()};function w(a,b){if(a.forEach)a.forEach(b,void 0);else for(var c=0,d=a.length;c<d;c++)c in a&&b.call(void 0,a[c],c,a)}function x(a,b){if(a.some)return a.some(b,void 0);for(var c=0,d=a.length;c<d;c++)if(c in a&&b.call(void 0,a[c],c,a))return!0;return!1}function y(a){return"[object Array]"==Object.prototype.toString.call(a)?a:[a]};function z(a,b){return A[a]=b}var A=window._spf_state||{};window._spf_state=A;var C={};"config"in A||z("config",C);C=A.config;function D(a){var b=E();a in b&&delete b[a]}function fa(){var a=E();for(b in a)F(a[b])||delete a[b];a=E();var b=parseInt(C["cache-max"],10);b=isNaN(b)?Infinity:b;b=Object.keys(a).length-b;if(!(0>=b))for(var c=0;c<b;c++){var d=Infinity,e;for(e in a)if(a[e].count<d){var f=e;d=a[e].count}delete a[f]}}function F(a){if(!(a&&"data"in a))return!1;var b=a.life;b=isNaN(b)?Infinity:b;a=a.time;return v()-a<b}function G(a){var b=parseInt(A["cache-counter"],10)||0;b++;z("cache-counter",b);a.count=b}
function E(){return"cache-storage"in A?A["cache-storage"]:z("cache-storage",{})};function H(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c}var I=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s+|\s+$/g,"")};function J(a,b){a=a.split(b);var c=1==a.length;return[a[0],c?"":b,c?"":a.slice(1).join(b)]};function K(a){a.data&&"[object String]"==Object.prototype.toString.call(a.data)&&0==a.data.lastIndexOf("spf:",0)&&L(a.data.substring(4))}function L(a){var b=M[a];b&&(delete M[a],b())}function N(a){window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent&&window.attachEvent("onmessage",a)}function O(a){window.removeEventListener?window.removeEventListener("message",a,!1):window.detachEvent&&window.detachEvent("onmessage",a)}
var P=function(){function a(){b=!1}if(!window.postMessage)return!1;var b=!0;N(a);window.postMessage("","*");O(a);return b}(),M={};"async-defers"in A||z("async-defers",M);M=A["async-defers"];P&&("async-listener"in A&&O(A["async-listener"]),N(K),z("async-listener",K));var Q={};"ps-s"in A||z("ps-s",Q);Q=A["ps-s"];function R(a){var b=document.createElement("a");b.href=a;b.href=b.href;a={href:b.href,protocol:b.protocol,host:b.host,hostname:b.hostname,port:b.port,pathname:b.pathname,search:b.search,hash:b.hash,username:b.username,password:b.password};a.origin=a.protocol+"//"+a.host;a.pathname&&"/"==a.pathname[0]||(a.pathname="/"+a.pathname);return a}function S(a){a=R(a);return J(a.href,"#")[0]};var T={},U={},ha={};"rsrc-s"in A||z("rsrc-s",T);T=A["rsrc-s"];"rsrc-n"in A||z("rsrc-n",U);U=A["rsrc-n"];"rsrc-u"in A||z("rsrc-u",ha);ha=A["rsrc-u"];var ia={};"js-d"in A||z("js-d",ia);ia=A["js-d"];var ja={};"js-u"in A||z("js-u",ja);ja=A["js-u"];function ka(a,b,c){if(b){b=[];var d=0;c&&(a+="\r\n");var e=a.indexOf("[\r\n",d);for(-1<e&&(d=e+3);-1<(e=a.indexOf(",\r\n",d));){var f=I(a.substring(d,e));d=e+3;f&&b.push(JSON.parse(f))}e=a.indexOf("]\r\n",d);-1<e&&(f=I(a.substring(d,e)),d=e+3,f&&b.push(JSON.parse(f)));f="";a.length>d&&(f=a.substring(d),c&&H(f,"\r\n")&&(f=f.substring(0,f.length-2)));b=V(b);return{m:b,g:f}}a=JSON.parse(a);b=V(y(a));return{m:b,g:""}}
function V(a){var b=y(a);w(b,function(c){if(c){c.head&&(c.head=W(c.head));if(c.body)for(var d in c.body)c.body[d]=W(c.body[d]);c.foot&&(c.foot=W(c.foot))}});return a}
function W(a){var b=new la;if(!a)return b;if("[object String]"!=Object.prototype.toString.call(a))return a.scripts&&w(a.scripts,function(c){b.scripts.push({url:c.url||"",text:c.text||"",name:c.name||"",async:c.async||!1})}),a.styles&&w(a.styles,function(c){b.styles.push({url:c.url||"",text:c.text||"",name:c.name||""})}),a.links&&w(a.links,function(c){"spf-preconnect"==c.rel&&b.links.push({url:c.url||"",rel:c.rel||""})}),b.html=a.html||"",b;a=a.replace(ma,function(c,d,e,f){if("script"==d){d=(d=e.match(X))?
d[1]:"";var h=e.match(na);h=h?h[1]:"";var k=oa.test(e);e=pa.exec(e);return(e=!e||-1!=e[1].indexOf("/javascript")||-1!=e[1].indexOf("/x-javascript")||-1!=e[1].indexOf("/ecmascript"))?(b.scripts.push({url:h,text:f,name:d,async:k}),""):c}return"style"==d&&(d=(d=e.match(X))?d[1]:"",e=pa.exec(e),e=!e||-1!=e[1].indexOf("text/css"))?(b.styles.push({url:"",text:f,name:d}),""):c});a=a.replace(qa,function(c,d){var e=d.match(ra);e=e?e[1]:"";return"stylesheet"==e?(e=(e=d.match(X))?e[1]:"",d=(d=d.match(sa))?d[1]:
"",b.styles.push({url:d,text:"",name:e}),""):"spf-preconnect"==e?(d=(d=d.match(sa))?d[1]:"",b.links.push({url:d,rel:e}),""):c});b.html=a;return b}function la(){this.html="";this.scripts=[];this.styles=[];this.links=[]}(function(){var a=document.createElement("div");return"transition"in a.style?!0:x(["webkit","Moz","Ms","O","Khtml"],function(b){return b+"Transition"in a.style})})();
var qa=/\x3clink([\s\S]*?)\x3e/ig,ma=/\x3c(script|style)([\s\S]*?)\x3e([\s\S]*?)\x3c\/\1\x3e/ig,oa=/(?:\s|^)async(?:\s|=|$)/i,sa=/(?:\s|^)href\s*=\s*["']?([^\s"']+)/i,X=/(?:\s|^)name\s*=\s*["']?([^\s"']+)/i,ra=/(?:\s|^)rel\s*=\s*["']?([^\s"']+)/i,na=/(?:\s|^)src\s*=\s*["']?([^\s"']+)/i,pa=/(?:\s|^)type\s*=\s*["']([^"']+)["']/i;/*

 SPF
 (c) 2012-2017 Google Inc.
 https://ajax.googleapis.com/ajax/libs/spf/2.4.0/LICENSE
*/
function ta(a,b,c,d){var e=d||{},f=!1,h=0,k,g=new XMLHttpRequest;g.open(a,b,!0);g.timing={};var m=g.abort;g.abort=function(){clearTimeout(k);g.onreadystatechange=null;m.call(g)};g.onreadystatechange=function(){var q=g.timing;if(2==g.readyState){q.responseStart=q.responseStart||v();if("json"==g.responseType)f=!1;else if(C["assume-all-json-requests-chunked"]||-1<(g.getResponseHeader("Transfer-Encoding")||"").toLowerCase().indexOf("chunked"))f=!0;else{q=g.getResponseHeader("X-Firefox-Spdy");var B=window.chrome&&
chrome.loadTimes&&chrome.loadTimes();B=B&&B.wasFetchedViaSpdy;f=!(!q&&!B)}e.u&&e.u(g)}else 3==g.readyState?f&&e.l&&(q=g.responseText.substring(h),h=g.responseText.length,e.l(g,q)):4==g.readyState&&(q.responseEnd=q.responseEnd||v(),window.performance&&window.performance.getEntriesByName&&(g.resourceTiming=window.performance.getEntriesByName(b).pop()),f&&e.l&&g.responseText.length>h&&(q=g.responseText.substring(h),h=g.responseText.length,e.l(g,q)),clearTimeout(k),e.s&&e.s(g))};"responseType"in g&&"json"==
e.responseType&&(g.responseType="json");e.withCredentials&&(g.withCredentials=e.withCredentials);d="FormData"in window&&c instanceof FormData;a="POST"==a&&!d;if(e.headers)for(var t in e.headers)g.setRequestHeader(t,e.headers[t]),"content-type"==t.toLowerCase()&&(a=!1);a&&g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");0<e.C&&(k=setTimeout(function(){g.abort();e.A&&e.A(g)},e.C));g.timing.fetchStart=v();g.send(c);return g};function ua(a,b,c,d,e){var f=!1;c.responseStart=c.responseEnd=v();b.type&&0==b.type.lastIndexOf("navigate",0)&&(c.navigationStart=c.startTime,C["cache-unified"]||(D(d),f=!0));b.j&&"multipart"==e.type&&w(e.parts,function(h){h.timing||(h.timing={});h.timing.spfCached=!!c.spfCached;h.timing.spfPrefetched=!!c.spfPrefetched;b.j(a,h)});va(a,b,c,e,f)}function wa(a,b,c){a=c.getResponseHeader("X-SPF-Response-Type")||"";b.o=-1!=a.toLowerCase().indexOf("multipart")}
function xa(a,b,c,d,e,f,h){if(d.o){f=d.g+f;try{var k=ka(f,!0,h)}catch(g){e.abort();b.i&&b.i(a,g,e);return}b.j&&w(k.m,function(g){g.timing||(g.timing={});g.timing.spfCached=!!c.spfCached;g.timing.spfPrefetched=!!c.spfPrefetched;b.j(a,g)});d.h=d.h.concat(k.m);d.g=k.g}}
function ya(a,b,c,d,e){if(e.timing)for(var f in e.timing)c[f]=e.timing[f];if(e.resourceTiming)if("load"==b.type)for(var h in e.resourceTiming)c[h]=e.resourceTiming[h];else if(window.performance&&window.performance.timing&&(f=window.performance.timing.navigationStart,f+e.resourceTiming.startTime>=c.startTime))for(var k in e.resourceTiming)h=e.resourceTiming[k],void 0!==h&&(H(k,"Start")||H(k,"End")||"startTime"==k)&&(c[k]=f+Math.round(h));"load"!=b.type&&(c.navigationStart=c.startTime);d.h.length&&
(d.g=I(d.g),d.g&&xa(a,b,c,d,e,"",!0));if("json"==e.responseType){if(!e.response){b.i&&b.i(a,Error("JSON response parsing failed"),e);return}var g=V(y(e.response))}else try{g=ka(e.responseText).m}catch(t){b.i&&b.i(a,t,e);return}if(b.j&&1<g.length)for(d=d.h.length;d<g.length;d++)e=g[d],e.timing||(e.timing={}),e.timing.spfCached=!!c.spfCached,e.timing.spfPrefetched=!!c.spfPrefetched,b.j(a,e);if(1<g.length){var m;w(g,function(t){t.cacheType&&(m=t.cacheType)});g={parts:g,type:"multipart"};m&&(g.cacheType=
m)}else g=1==g.length?g[0]:{};va(a,b,c,g,!0)}function va(a,b,c,d,e){if(e&&"POST"!=b.method&&(e=za(a,b.current,d.cacheType,b.type,!0))){d.cacheKey=e;var f={response:d,type:b.type||""},h=parseInt(C["cache-lifetime"],10),k=parseInt(C["cache-max"],10);0>=h||0>=k||(k=E(),f={data:f,life:h,time:v(),count:0},G(f),k[e]=f,setTimeout(fa,1E3))}d.timing=c;b.v&&b.v(a,d)}
function za(a,b,c,d,e){a=S(a);var f;C["cache-unified"]?f=a:"navigate-back"==d||"navigate-forward"==d?f="history "+a:"navigate"==d?f=(e?"history ":"prefetch ")+a:"prefetch"==d&&(f=e?"prefetch "+a:"");b&&"url"==c?f+=" previous "+b:b&&"path"==c&&(f+=" previous "+R(b).pathname);return f||""}
function Aa(a,b){var c=[];b&&(c.push(a+" previous "+b),c.push(a+" previous "+R(b).pathname));c.push(a);var d=null;x(c,function(e){a:{var f=E();if(e in f){f=f[e];if(F(f)){G(f);f=f.data;break a}D(e)}f=void 0}f&&(d={key:e,response:f.response,type:f.type});return!!f});return d}function Ba(){this.o=!1;this.g="";this.h=[]};function Y(a,b){if(a){var c=Array.prototype.slice.call(arguments);c[0]=a;c=ea.apply(null,c)}return!1!==c};function Ca(a,b,c,d){Y((a||{}).onError,{url:b,err:c,xhr:d})}function Da(a,b,c){Y((a||{}).onPartProcess,{url:b,part:c})&&Y((a||{}).onPartDone,{url:b,part:c})}function Ea(a,b,c){var d;(d="multipart"==c.type)||(d=Y((a||{}).onProcess,{url:b,response:c}));d&&Y((a||{}).onDone,{url:b,response:c})}
var Fa={request:function(a,b){b=b||{};b={method:b.method,headers:b.experimental_headers,j:u(Da,null,b),i:u(Ca,null,b),v:u(Ea,null,b),D:b.postData,type:"",current:window.location.href,B:window.location.href};b.method=((b.method||"GET")+"").toUpperCase();b.type=b.type||"request";var c=a,d=C["url-identifier"]||"";if(d){d=d.replace("__type__",b.type||"");var e=J(c,"#"),f=J(e[0],"?");c=f[0];var h=f[1];f=f[2];var k=e[1];e=e[2];if(0==d.lastIndexOf("?",0))h&&(d=d.replace("?","&")),f+=d;else{if(0==d.lastIndexOf(".",
0))if(H(c,"/"))d="index"+d;else{var g=c.lastIndexOf(".");-1<g&&(c=c.substring(0,g))}else H(c,"/")&&0==d.lastIndexOf("/",0)&&(d=d.substring(1));c+=d}c=c+h+f+k+e}d=S(c);c={};c.spfUrl=d;c.startTime=v();c.fetchStart=c.startTime;h=za(a,b.current,null,b.type,!1);h=Aa(h,b.current);c.spfPrefetched=!!h&&"prefetch"==h.type;c.spfCached=!!h;if(h){a=u(ua,null,a,b,c,h.key,h.response);b=window._spf_state=window._spf_state||{};var m=parseInt(b.uid,10)||0;m++;b=b.uid=m;M[b]=a;P?window.postMessage("spf:"+b,"*"):window.setTimeout(u(L,
null,b),0);a=null}else{h={};if(f=C["request-headers"])for(m in f)k=f[m],h[m]=null==k?"":String(k);if(b.headers)for(m in b.headers)k=b.headers[m],h[m]=null==k?"":String(k);null!=b.B&&(h["X-SPF-Referer"]=b.B);null!=b.current&&(h["X-SPF-Previous"]=b.current);if(m=C["advanced-header-identifier"])h["X-SPF-Request"]=m.replace("__type__",b.type),h.Accept="application/json";m=new Ba;f=u(ya,null,a,b,c,m);a={headers:h,C:C["request-timeout"],u:u(wa,null,a,m),l:u(xa,null,a,b,c,m),s:f,A:f};b.withCredentials&&
(a.withCredentials=b.withCredentials);C["advanced-response-type-json"]&&(a.responseType="json");a="POST"==b.method?ta("POST",d,b.D,a):ta("GET",d,null,a)}return a}},n=this;n.spf=n.spf||{};var Ga=n.spf,Z;for(Z in Fa)Ga[Z]=Fa[Z];}).call(this);
const arr1 = [ 1, 2, 3 ];
const arr2 = [ 3, 5, 4, 2, 7, 0, 1, 10 ];

let hasAllElems = true;

for (let i = 0; i < arr1.length; i++){
    if (arr2.indexOf(arr1[i]) === -1) {
        hasAllElems = false;
        break;
    }
}

console.log(hasAllElems); // output: true
onClick={() => window.open(url, "_blank")}
@echo off
title Activate Windows 10 (ALL versions) for FREE - MSGuides.com&cls&echo =====================================================================================&echo #Project: Activating Microsoft software products for FREE without additional software&echo =====================================================================================&echo.&echo #Supported products:&echo - Windows 10 Home&echo - Windows 10 Professional&echo - Windows 10 Education&echo - Windows 10 Enterprise&echo.&echo.&echo ============================================================================&echo Activating your Windows...&cscript //nologo slmgr.vbs /ckms >nul&cscript //nologo slmgr.vbs /upk >nul&cscript //nologo slmgr.vbs /cpky >nul&set i=1&wmic os | findstr /I "enterprise" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43 >nul||cscript //nologo slmgr.vbs /ipk DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4 >nul||cscript //nologo slmgr.vbs /ipk YYVX9-NTFWV-6MDM3-9PT4T-4M68B >nul||cscript //nologo slmgr.vbs /ipk 44RPN-FTY23-9VTTB-MP9BX-T84FV >nul||cscript //nologo slmgr.vbs /ipk WNMTR-4C88C-JK8YV-HQ7T2-76DF9 >nul||cscript //nologo slmgr.vbs /ipk 2F77B-TNFGY-69QQF-B8YKP-D69TJ >nul||cscript //nologo slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ >nul||cscript //nologo slmgr.vbs /ipk QFFDN-GRT3P-VKWWX-X7T3R-8B639 >nul||cscript //nologo slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D >nul||cscript //nologo slmgr.vbs /ipk 92NFX-8DJQP-P6BBQ-THF9C-7CG2H >nul&goto skms) else wmic os | findstr /I "home" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul||cscript //nologo slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul||cscript //nologo slmgr.vbs /ipk 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH >nul||cscript //nologo slmgr.vbs /ipk PVMJN-6DFY6-9CCP6-7BKTT-D3WVR >nul&goto skms) else wmic os | findstr /I "education" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 >nul||cscript //nologo slmgr.vbs /ipk 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ >nul&goto skms) else wmic os | findstr /I "10 pro" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul||cscript //nologo slmgr.vbs /ipk MH37W-N47XK-V7XM9-C7227-GCQG9 >nul||cscript //nologo slmgr.vbs /ipk NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J >nul||cscript //nologo slmgr.vbs /ipk 9FNHH-K3HBT-3W4TD-6383H-6XYWF >nul||cscript //nologo slmgr.vbs /ipk 6TP4R-GNPTD-KYYHQ-7B7DP-J447Y >nul||cscript //nologo slmgr.vbs /ipk YVWGF-BXNMC-HTQYQ-CPQ99-66QFC >nul&goto skms) else (goto notsupported)
:skms
if %i% GTR 10 goto busy
if %i% EQU 1 set KMS=kms7.MSGuides.com
if %i% EQU 2 set KMS=s8.uk.to
if %i% EQU 3 set KMS=s9.us.to
if %i% GTR 3 goto ato
cscript //nologo slmgr.vbs /skms %KMS%:1688 >nul
:ato
echo ============================================================================&echo.&echo.&cscript //nologo slmgr.vbs /ato | find /i "successfully" && (echo.&echo ============================================================================&echo.&echo #My official blog: MSGuides.com&echo.&echo #How it works: bit.ly/kms-server&echo.&echo #Please feel free to contact me at msguides.com@gmail.com if you have any questions or concerns.&echo.&echo #Please consider supporting this project: donate.msguides.com&echo #Your support is helping me keep my servers running 24/7!&echo.&echo ============================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto skms)
explorer "http://MSGuides.com"&goto halt
:notsupported
echo ============================================================================&echo.&echo Sorry, your version is not supported.&echo.&goto halt
:busy
echo ============================================================================&echo.&echo Sorry, the server is busy and can't respond to your request. Please try again.&echo.
:halt
pause >nul
$original = [
    'user' => [
        'name' => 'foo',
        'occupation' => 'bar',
    ]
];
 
$dotted = Arr::dot($original);
 
// Results in...
$dotted = [
    'user.name' => 'foo',
    'user.occupation' => 'bar',
];
<div class="skt-hero"> <!--Inicia contenedor -->
<div class="columnas z1" style="--backgroundImg: url(https://cdn.thecoolist.com/wp-content/uploads/2016/05/Japanese-Cherry-beautiful-tree.jpg)">1ahola</div>
<div class="columnas z2" style="--backgroundImg: url(https://wallpaperstock.net/wonderful-trees-path-sun-light-wallpapers_47680_1920x1200.jpg)">2a</div>
<div class="columnas z3" style="--backgroundImg: url(https://img.culturacolectiva.com/featured_image/2018/10/04/1538678265674/deforestacion-del-bosque-amazonico-diecisiete-por-ciento.jpg)" >3a</div>
<div class="columnas z4" style="--backgroundImg: url(https://st.depositphotos.com/1012061/4434/i/600/depositphotos_44342021-stock-photo-sun-rays-inside-coconut-palms.jpg)">4a</div>
</div> <!-- Fin del contenedor -->

// css 

body{
z-index: -10:
} /* para asegurar que nadie este por debajo de body*/
.skt-hero {
    position: absolute;
    width: 100vw;
    height: 100vh;
    display: flex;
    background-image: url(https://haciendofotos.com/wp-content/uploads/las-mejores-fotos-de-paisajes-2020.jpg);
    background-size: cover;
}
.skt-hero:hover{
    z-index:-3;
}
.columnas {
    width: 25%;
    height: 100%;
    border: 1px solid gray;
    background-color: transparent;
    position:absolute;
    opacity: 0.05;
    transition: opacity 2s ease;
}
.columnas:hover {
    height: 100%;
    width:100vw;
    background-image: var(--backgroundImg);
    position: ;
    z-index: -1;
    background-size: cover;
    opacity: 1;
}
.z1{
left:0%;
}
.z1:hover{
left:0%;
}
.z2{
left:25%;
}
.z2:hover{
left:0%;
}
.z3{
left:50%;
}
.z3:hover{
left:0%;
}
.z4{
left:75%;
}
.z4:hover{
left:0%;
}
# Definition of dictionary
europe = {'spain':'madrid', 'france':'paris', 'germany':'berlin', 'norway':'oslo' }

# Print out the keys in europe
print(europe.keys())

# Print out value that belongs to key 'norway'
print(europe['norway'])
#include<bits/stdc++.h>
using namespace std;
#define SIZE 5
int a[SIZE];
int front  =-1;

void push(int data)
{ 
 if(front==SIZE-1)
 {
   std::cout << "stack is full" << std::endl;
     
 }
 else{
   front++;
   a[front]=data;
 }
}

//function to pop 
void pop()
{
    if(front==-1)
    {
        cout<<"not element to pop";
    }
    else
    {
       //cout<<a[front];
        front--;
    }
}

void show()
{
    for(int i =0 ;i<=front;i++)
    {
        cout<<a[i];
        cout<<endl;
    }
}

int main()
{
 push(2);
 push(3);
 push(4);
 show();
 pop();
 show();
}
span {
  min-height: 100px;
  display: inline-flex;
  align-items: center;
  border: 1px solid aqua;
}
// making all uppercase
city.toUpperCase();

//removing spaces and making all lowercase
city = city.trim().toLowerCase();

//capitalizing the first letter
cityCapitalized = city.charAt(0).toUpperCase() + city.slice(1);
# install docker

 $ wget -nv -O - https://get.docker.com/ | sh

 # setup dokku apt repository

 $ wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -

 $ export SOURCE="https://packagecloud.io/dokku/dokku/ubuntu/"

 $ export OS_ID="$(lsb_release -cs 2>/dev/null || echo "bionic")"

 $ echo "bionic focal" | grep -q "$OS_ID" || OS_ID="bionic"

 $ echo "deb $SOURCE $OS_ID main" | tee /etc/apt/sources.list.d/dokku.list

 $ apt-get update

 # install dokku

 $ apt-get install dokku

 $ dokku plugin:install-dependencies --core # run with root!

 # Configure your server domain via `dokku domains:set-global`

 # and user access (via `dokku ssh-keys:add`) to complete the installation
<script> 
jQuery(document).ready(function($) { 
var delay = 100; setTimeout(function() { 
jQuery('.elementor-tab-title').removeClass('elementor-active');
jQuery('.elementor-tab-content').css('display', 'none'); }, delay); 
}); 
</script>
#!/bin/bash
echo "[+] Installing XFCE4, this will take a while"
apt-get update
apt-get dist-upgrade -y --force-yes
apt-get --yes --force-yes install kali-desktop-xfce xorg xrdp
echo "[+] Configuring XRDP to listen to port 3390 (but not starting the service)..."
sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini
# function to replace rows in the provided column of the provided dataframe
# that match the provided string above the provided ratio with the provided string
def replace_matches_in_column(df, column, string_to_match, min_ratio = 47):
    # get a list of unique strings
    strings = df[column].unique()
    
    # get the top 10 closest matches to our input string
    matches = fuzzywuzzy.process.extract(string_to_match, strings, 
                                         limit=10, scorer=fuzzywuzzy.fuzz.token_sort_ratio)

    # only get matches with a ratio > 90
    close_matches = [matches[0] for matches in matches if matches[1] >= min_ratio]

    # get the rows of all the close matches in our dataframe
    rows_with_matches = df[column].isin(close_matches)

    # replace all rows with close matches with the input matches 
    df.loc[rows_with_matches, column] = string_to_match
    
    # let us know the function's done
    print("All done!")
df['SettlementDate'] = pd.TimedeltaIndex(df['SettlementDate'], unit='d') + dt.datetime(1900,1,1)
DECLARE @AnyDate DATETIME
SET @AnyDate = GETDATE()

SELECT @AnyDate AS 'Input Date',
  DATEADD(q, DATEDIFF(q, 0, @AnyDate), 0) 
                        AS 'Quarter Start Date',       
  DATEADD(d, -1, DATEADD(q, DATEDIFF(q, 0, @AnyDate) + 1, 0)) 
                        AS 'Quarter End Date'
// THE HTML/PHP

// Categories Nav START
<? $terms = get_terms( array(
    'taxonomy' => 'category-name', // <-- update this
    'orderby' => 'ID',
  )); 
  if ( $terms && !is_wp_error( $terms ) ){ ?>
   <ul class="CHANGEME-categories-nav">
      <? foreach( $terms as $term ) { ?>
        <li id="cat-<?php echo $term->term_id; ?>">
           <a href="#" class="<?= $term->slug; ?> ajax" data-term-number="<?= $term->term_id; ?>" title="<?= $term->name;?>"><?= $term->name; ?></a>
        </li>
      <? } ?>
   </ul>
<? } ?>
// Categories Nav END
                                       
// Results Container START
<div id="CHANGEME-results-container" class="CHANGEME-filter-result">
   <? // post query
     $query = new WP_Query( array(
        'post_type' => 'post-name', // <-- update this
        'posts_per_page' => -1,
      ) ); 
   if( $query->have_posts() ): while( $query->have_posts()): $query->the_post(); ?>
    
      // POST TEMPLATE HERE
    
   <? endwhile; endif; wp_reset_query(); ?>
</div>                      
// Results Container END

// The onpage JS for the page template
<script>
(function($) {
        'use strict';
        function cat_ajax_get(catID) {
            jQuery.ajax({
                type: 'POST',
                url: raindrop_localize.ajaxurl,
                data: {"action": "filter", cat: catID },
                success: function(response) {
                    jQuery("#CHANGEME-results-container").html(response);
                    return false;
                }
            });
        }
        $( ".CHANGEME-categories-nav a.ajax" ).click(function(e) {
            e.preventDefault();
            $("a.ajax").removeClass("current");
            $(this).addClass("current"); //adds class current to the category menu item being displayed so you can style it with css
            var catnumber = $(this).attr('data-term-number');
            cat_ajax_get(catnumber);
        });

    })(jQuery);
</script>
                                       
// Callback function for functions.php or some other functions specific php file like theme.php
// Aside from the inital add actions and a few other things, the actual query and post template should be the same as what is on the page.
                                       
add_action( 'wp_ajax_nopriv_filter', 'CHANGEME_cat_posts' );
add_action( 'wp_ajax_filter', 'CHANGEME_cat_posts' );
                                       
function CHANGEME_cat_posts () {
    $cat_id = $_POST[ 'cat' ];
    $args = array (
	  'tax_query' => array(
		    array(
		      'taxonomy' => 'category-name', // <-- update this
		      'field' => 'term_id',
		      'terms' => array( $cat_id )
		    )
		  ),
	    'post_type' => 'post-name', // <-- update this
	    'posts_per_page' => -1,
	  );
	global $post;
    $posts = get_posts( $args );
    ob_start ();
    foreach ( $posts as $post ) { 
	    setup_postdata($post); ?>

	    // POST TEMPLATE HERE

   <?php } wp_reset_postdata();
   $response = ob_get_contents();
   ob_end_clean();
   echo $response;
   die(1);
}
const mongoose = require("mongoose");

const validId = (id) => {
  return mongoose.Types.ObjectId.isValid(id);
};

module.exports = validId;
const Slider = () => {

const { data, loading, error } = useQuery(GET_LATEST_POSTS)


const [ currentMovie, setMovie ] = useState()

 useEffect(() => {
    if(!loading && data){
        setMovie(data);
    }
  }, [loading, data])

if (loading) return 'Loading...'               //your component's return should always be after all hook calls//
if (error) return `Error! ${error.message}`
}
docker ps //List running containers
docker ps --all //List all containers
docker system prune //Remove unused data
docker system prune --all //Remove all unused images not just dangling ones
docker run {IMAGE} //combining 'docker create' & 'docker start'
docker run -d {IMAGE} // Run container in background and print container ID
docker run -p {systemport}:{dockerport} {IMAGE} // Map Port of the OS to the dockerport
docker run -it {IMAGE} //Input output
docker run -it {IMAGE} sh //Run docker container and shell into it
docker exec -it {IMAGE} sh //Shell into running docker container
docker build . //Build docker image with random id 
docker build -t {REPO}/{TAGNAME}. //Build docker image with random id 
docker stop {IMAGE} //Stop container from running

docker-compose up //Execute docker compose
docker-compose up --build // Rebuild Docker container and execute docker compose
docker-compose -d {IMAGE} // Run container in background and print container ID
docker-compose down //Stop container from running
                Container(
                  height: SizeConfig.safeBlockVertical * 24,
                  width: SizeConfig.safeBlockHorizontal * 45,
                  padding: EdgeInsets.only(
                      left: SizeConfig.safeBlockHorizontal * 5,
                      right: SizeConfig.safeBlockHorizontal * 4,
                      bottom: SizeConfig.safeBlockVertical * 2),
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      color: Colors.white,
                      gradient: RadialGradient(
                          focalRadius: 100,
                          radius: 1.5,
                          center: Alignment.bottomLeft,
                          colors: [
                            colorStyles["maslowGreen"]!.withOpacity(0.65),
                            colorStyles["maslowGreen"]!.withOpacity(0.65),
                          ],
                          stops: [
                            0.0,
                            1.0
                          ])),
                  child: _collectionName(),
                ),
# WSL2 network port forwarding script v1
#   for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
#   for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
#   written by Daehyuk Ahn, Aug-1-2020

# Display all portproxy information
If ($Args[0] -eq "list") {
    netsh interface portproxy show v4tov4;
    exit;
} 

# If elevation needed, start new process
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
  # Relaunch as an elevated process:
  Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path),"$Args runas" -Verb RunAs
  exit
}

# You should modify '$Ports' for your applications 
$Ports = (22,80,443,8080)

# Check WSL ip address
wsl hostname -I | Set-Variable -Name "WSL"
$found = $WSL -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if (-not $found) {
  echo "WSL2 cannot be found. Terminate script.";
  exit;
}

# Remove and Create NetFireWallRule
Remove-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock';
if ($Args[0] -ne "delete") {
  New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Outbound -LocalPort $Ports -Action Allow -Protocol TCP;
  New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort $Ports -Action Allow -Protocol TCP;
}

# Add each port into portproxy
$Addr = "0.0.0.0"
Foreach ($Port in $Ports) {
    iex "netsh interface portproxy delete v4tov4 listenaddress=$Addr listenport=$Port | Out-Null";
    if ($Args[0] -ne "delete") {
        iex "netsh interface portproxy add v4tov4 listenaddress=$Addr listenport=$Port connectaddress=$WSL connectport=$Port | Out-Null";
    }
}

# Display all portproxy information
netsh interface portproxy show v4tov4;

# Give user to chance to see above list when relaunched start
If ($Args[0] -eq "runas" -Or $Args[1] -eq "runas") {
  Write-Host -NoNewLine 'Press any key to close! ';
  $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
}
const sessionMiddleware = expressSession({
    secret: 'Tecky Academy teaches typescript',
    resave:true,
    saveUninitialized:true,
    cookie:{secure:false}
});

app.use(sessionMiddleware);

io.use((socket,next)=>{
    let req = socket.request as express.Request
    let res = req.res as express.Response
    sessionMiddleware(req, res, next as express.NextFunction
});
//...
io.on('connection', function (socket) {
    // You can set any values you want to session here.
    const req = socket.request as express.Request;
    req.session['key'] = 'XXX';
    // There is no auto save for session.
    socket.request.session.save();

    // You can also send data using socket.emit() although it is not very useful
    socket.emit('any-key','values');
    socket.on("disconnect",()=>{
        //... rest of the code
    })
});
new_sheet = workbook.create_sheet(sheetName)
default_sheet = workbook['default']

from copy import copy

for row in default_sheet.rows:
    for cell in row:
        new_cell = new_sheet.cell(row=cell.row, column=cell.col_idx,
                value= cell.value)
        if cell.has_style:
            new_cell.font = copy(cell.font)
            new_cell.border = copy(cell.border)
            new_cell.fill = copy(cell.fill)
            new_cell.number_format = copy(cell.number_format)
            new_cell.protection = copy(cell.protection)
            new_cell.alignment = copy(cell.alignment)
SELECT Column(s) FROM table_name WHERE column IN (value1, value2, ... valueN);
star

Sun Feb 06 2022 23:42:45 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/possible-words-from-phone-digits-1587115620/1/?track=DSASP-Recursion&batchId=190

@Uttam #java #gfg #geeksforgeeks #recursion #possiblewordsfrom phone digits

star

Sun Feb 06 2022 01:36:19 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/quadratic-equation-roots/1/?track=DSASP-Mathematics&batchId=190

@Uttam #java #mathematics #gfg #geeksforgeeks #quadraticequationroots

star

Thu Feb 03 2022 18:39:15 GMT+0000 (Coordinated Universal Time) https://github.com/h5bp/create-html5-boilerplate

@bdaley #bash

star

Wed Feb 02 2022 22:08:42 GMT+0000 (Coordinated Universal Time) https://github.com/jimbrig/dotfiles-wsl/blob/main/scripts/dev/scripts/install-gh-cli.sh

@jimbrig #installation #linux #bash #wsl #github #cli

star

Wed Feb 02 2022 02:25:53 GMT+0000 (Coordinated Universal Time) https://github.com/AutoViML/AutoViz

@jmbenedetto #python

star

Sun Jan 30 2022 11:39:22 GMT+0000 (Coordinated Universal Time)

@abir_hasnat95 #flutter #dart

star

Sun Jan 30 2022 03:20:34 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/replace-loops-using-recursion

@Bekzod

star

Thu Jan 27 2022 09:46:57 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=ZPqfk8th8wU&list=PL95Y-qRNDwcjzMq69E_knrb71HlngbS-E

@Thaweephan

star

Mon Jan 24 2022 21:11:42 GMT+0000 (Coordinated Universal Time) https://programmingwithmosh.com/react/guide-to-learn-useeffect-hook-in-react/

@erinksmith

star

Sun Jan 23 2022 13:31:13 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/a/518232

@jmbenedetto #python

star

Thu Jan 20 2022 08:53:52 GMT+0000 (Coordinated Universal Time)

@CaoimhedeFrein #python

star

Wed Jan 19 2022 10:59:48 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/26658535/building-table-dynamically-with-pdfmake

@pythonDON3000 #javascript

star

Fri Jan 14 2022 15:10:07 GMT+0000 (Coordinated Universal Time) https://gist.github.com/rahulbagal/4a06a997497e6f921663b69e5286d859

@lewiseman #flutter

star

Wed Jan 12 2022 19:24:10 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date

@yuio #javascript

star

Tue Jan 11 2022 21:41:16 GMT+0000 (Coordinated Universal Time)

@shadowtek #wordpress #css

star

Mon Jan 10 2022 17:02:27 GMT+0000 (Coordinated Universal Time) https://github.com/explosion-scratch/cool_apis

@Explosion #js #javascript #rewrite #api

star

Sat Jan 08 2022 02:04:37 GMT+0000 (Coordinated Universal Time) https://css-tricks.com/snippets/sass/extend-wrapper-aka-mixtend/

@wnakswl #html #snipet #sublime

star

Wed Jan 05 2022 11:37:29 GMT+0000 (Coordinated Universal Time)

@KarenStewart #javascript

star

Wed Dec 22 2021 16:28:12 GMT+0000 (Coordinated Universal Time)

@mmerkley #html

star

Mon Dec 20 2021 13:07:43 GMT+0000 (Coordinated Universal Time)

@verena_various #yarn

star

Sun Dec 19 2021 15:55:57 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/s/desktop/21ad9f7d/jsbin/network.vflset/network.js

@Devanarayanan12

star

Tue Dec 14 2021 19:59:19 GMT+0000 (Coordinated Universal Time) https://www.designcise.com/web/tutorial/how-to-check-if-an-array-contains-all-elements-of-another-array-in-javascript

@arielvol

star

Mon Dec 13 2021 13:39:01 GMT+0000 (Coordinated Universal Time)

@dickosmad #react.js

star

Sun Dec 05 2021 01:06:47 GMT+0000 (Coordinated Universal Time) https://msguides.com/windows-10

@xyzemail23@gmail.com #windows #10

star

Thu Dec 02 2021 08:00:24 GMT+0000 (Coordinated Universal Time) https://laravel-news.com/laravel-8-74-0

@sayedsadat344 #php #laravel

star

Mon Nov 29 2021 23:44:23 GMT+0000 (Coordinated Universal Time) https://es.stackoverflow.com/questions/499239/transici%c3%b3n-css-de-background-image/500273#500273

@samn #css #html #z-index

star

Tue Nov 23 2021 10:06:27 GMT+0000 (Coordinated Universal Time) https://campus.datacamp.com/courses/intermediate-python/dictionaries-pandas?ex=4

@Sourabh

star

Sat Nov 13 2021 09:48:26 GMT+0000 (Coordinated Universal Time)

@Naredra

star

Fri Nov 12 2021 13:51:39 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/37754621/how-to-vertically-center-text-in-a-span/37754674

@arielvol #css

star

Mon Nov 08 2021 17:37:30 GMT+0000 (Coordinated Universal Time) https://dokku.com/

@pirate

star

Thu Nov 04 2021 16:02:23 GMT+0000 (Coordinated Universal Time)

@Nandrei89 #jquery

star

Sun Oct 24 2021 04:54:23 GMT+0000 (Coordinated Universal Time) https://gitlab.com/kalilinux/build-scripts/kali-wsl-chroot/-/blob/master/xfce4.sh

@gallinio

star

Thu Oct 21 2021 09:54:39 GMT+0000 (Coordinated Universal Time)

@Ariendal #python #pandas

star

Mon Oct 18 2021 02:56:55 GMT+0000 (Coordinated Universal Time)

@ianh #python #datetime #pandas

star

Sat Oct 09 2021 17:28:32 GMT+0000 (Coordinated Universal Time) https://sqlhints.com/2013/07/20/how-to-get-quarter-start-end-date-sql-server/

@rick_m #sql

star

Thu Oct 07 2021 20:09:32 GMT+0000 (Coordinated Universal Time)

@markf_raindrop #javascript #jquery #php #html

star

Thu Oct 07 2021 04:46:38 GMT+0000 (Coordinated Universal Time)

@rook12 #javascript

star

Sat Oct 02 2021 22:55:20 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/60736179/how-to-usestate-and-usequery-in-apollo-graphql-and-react

@junior #javascript

star

Fri Oct 01 2021 11:30:05 GMT+0000 (Coordinated Universal Time)

@alexactivate #docker

star

Fri Sep 24 2021 02:03:52 GMT+0000 (Coordinated Universal Time)

@viewsource #dart

star

Sat Sep 04 2021 08:05:25 GMT+0000 (Coordinated Universal Time)

@RokoMetek #bash #powershell

star

Sat Aug 21 2021 16:04:58 GMT+0000 (Coordinated Universal Time) https://lolz.guru/market/17950329/

@SHAWTY

star

Thu Aug 19 2021 17:56:37 GMT+0000 (Coordinated Universal Time)

@ExplodeMilk #typescript #express #socketio

star

Wed Aug 18 2021 17:10:30 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/23332259/copy-cell-style-openpyxl

@kenleyarai #python

star

Fri Aug 13 2021 20:14:36 GMT+0000 (Coordinated Universal Time) https://www.journaldev.com/19165/sql-in-sql-not-in

@mvieira

Save snippets that work with our extensions

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