Snippets Collections
  class MyBlinkingButton extends StatefulWidget {
    @override
    _MyBlinkingButtonState createState() => _MyBlinkingButtonState();
  }

  class _MyBlinkingButtonState extends State<MyBlinkingButton>
      with SingleTickerProviderStateMixin {
    AnimationController _animationController;

    @override
    void initState() {
      _animationController =
          new AnimationController(vsync: this, duration: Duration(seconds: 1));
      _animationController.repeat(reverse: true);
      super.initState();
    }

    @override
    Widget build(BuildContext context) {
      return FadeTransition(
        opacity: _animationController,
        child: MaterialButton(
          onPressed: () => null,
          child: Text("Text button"),
          color: Colors.green,
        ),
      );
    }

    @override
    void dispose() {
      _animationController.dispose();
      super.dispose();
    }
  }
                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(),
                ),
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,
                  ),
                ),
 """ 
'UserWarning: pyproj unable to set database path.' <- This happens with multiple pyproj installations on the same machine, which is quite common, as almost every geo software depends on it.

How to fix:
First, find all copies of 'proj.db' on the machine. Get the path for the correct one, which is probably something like 'C:/Users/Clemens Berteld/.conda/pkgs/proj-8.2.0-h1cfcee9_0/Library/share/proj'. Definitively not a QGIS or PostGIS path.

Then, use it as a parameter for this function and run it at the top of your code:
"""

def set_pyproj_path(proj_path):
    from pyproj import datadir
    datadir.set_data_dir(proj_path)
    # print(datadir.get_data_dir.__doc__)
df['SettlementDate'] = pd.TimedeltaIndex(df['SettlementDate'], unit='d') + dt.datetime(1900,1,1)
String fileFullPath = "Your\\java\\ file \\full\\path";
    JavaDocBuilder builder = new JavaDocBuilder();
    builder.addSource(new FileReader( fileFullPath  ));

    JavaSource src = builder.getSources()[0];
    String[] imports = src.getImports();

    for ( String imp : imports )
    {
        System.out.println(imp);
    }
class Solution:
    #number of permutations = n! 
    def permute(self, nums: List[int]) -> List[List[int]]:
        result = []
    
        if len(nums) == 1: 
            return [nums[:]] 
        
        for i in range(len(nums)): 
            #pop off first element 
            n = nums.pop(0)
            
            #numswill now have one less value, will append popped value later 
            perms = self.permute(nums) 
            
            for perm in perms: 
                perm.append(n)
            
            result.extend(perms)
            #adding popped back 
            nums.append(n) 
        
        return result 
 
 
def merge_two_dicts(a, b):
 
 
   c = a.copy()   # make a copy of a
 
   c.update(b)    # modify keys and values of a with the ones from b
 
   return c
 
 
 
 
 
a = { 'x': 1, 'y': 2}
 
b = { 'y': 3, 'z': 4}
 
 
print(merge_two_dicts(a, b)) # {'y': 3, 'x': 1, 'z': 4}
 
 
#include <bits/stdc++.h>
using namespace std;


int main() {
     int n ;
     cin>>n;
     vector<pair<int , int> >p;
     for(int i=0;i<n;i++){
         int a, b ;
         cin>>a >>b ;
         int c=a+b;
         p.push_back({c,a});
         
         
        }
     reverse(p.begin(),p.end());
     
     int c=0;
     int ans=0;
     for(int i=0; i<n ;i++){
          c+=p[i].first;
          int sum=0;
         while(i+1<n){
             sum+=p[i+1].second;
             
             i++;
             
         }
         if(c>sum){
             ans=i+1;
             break; 
            }
         
         
         
        }
     
    cout<< ans;
   return 0; 
}
# Git Commands

## git init
initialize git and create a new local repository

## git add .
track all the files in the local repo for changes

## git add filename
track a specific file in the repo for changes

## git commit -m "first commit" -m "the description"
take a snapshot of the files in the repo

## git status
check the status of your code

## git remote add origin https-link
add a new remote repository

## git push origin master
push the local repository to github

## git push -u origin master
push the local repository to github and also set upstream (enables you to use git push only in future)

## git branch
check the current branch and available branches

## git checkout -b new-branch-name
go to another new branch

## git checkout existing-branch
switch to an existing branch

## git diff feature
see the difference between files you want to merge

## git config --global user.name "[name]"
Sets the name you want attached to your commit transactions

## git config --global user.email "[email address]"
Sets the email you want attached to your commit transactions

## git config --global color.ui auto
Enables helpful colorization of command line output

## git push
use this cmd when pushing a new branch to see how it should be done

## git pull
when upstream is set , to pull from github when changes made on the github and want them to reflect on local machine

## git pull origin master
to pull from github when changes made on the github and want them to reflect on local machine

## git branch -d branch-name
delete a branch

## git commit -am "message"
commit and add at the same time
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
more: https://gist.github.com/endolith/157796

ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻ 

http://www.fileformat.info/convert/text/upside-down.htm

ಠ_ಠ [disapprove]
Ծ_Ծ [disapprove]
ಠ~ಠ [hrm…]
ఠ_ఠ [o rly?]
ಠ_ರೃ [dignified]
ಠ_ృ [dignified]
ಠ╭╮ಠ [frown]
◔_◔ [rolling eyes]
𝄇⥀.⥀𝄆 [rolling eyes]
⊙_ʘ [crazy/wonky]
◴_◶ [herp derp]
◕ ◡ ◕ [smile]
(๏̯͡๏﴿ [sad]
(͡๏̯͡๏) [sad]
◔̯◔ [sad]
⊙︿⊙ [sad]
◕︵◕ [sad]
●︵• [sad]
◉︵◉ [really sad]
ಡ_ಡ [misty eyes]
ಥ_ಥ [crying]
ಢ_ಢ [crying]
ಢ_ಥ [heavily distraught]
⊙﹏⊙ [embarrassed]
( ゚o゚) [surprised]
⋋_⋌ [frustrated]
〴⋋_⋌〵[angry]
ಠ益ಠ [rage]
ヽ(`Д´)ノ [raging] ‎(ノ≥∇≤)ノ [raging]
(︶ε︶メ) [deep breaths]
˚▱˚ [gasp]
⊙▂⊙ [gasp]
⊙▃⊙ [bigger gasp]
(ΘεΘ;) [nervous]
(゚ヮ゚) [happy]
〓D [happy]
(´ー`) [content]
(´▽`) [haha]
(゚*゚) [pucker]
(。・_・。) [blush]
♥╭╮♥ [lovesick]
≖◡ಎ≖ [devious]
(///_ಥ) [injured]
(≥_<) [black eye]
ʕʘ‿ʘʔ [doofy]
:-þ [silly]
:^Þ
¯\_(ツ)_/¯ [lol i dunno]
ヘ(◕。◕ヘ) [ballin]
๏_๏ [stare]
◉_◉
ਉ_ਉ [tired]
☼_☼ [bulging|bloodshot]
♨_♨ [CAN’T UNSEE] ☯‿☯ [peace]
(゚ー゚) [cool]
(• ε •) [sheepish]
(`・ω・´)
¬_¬ [glare]
ಸ_ಸ
ↁ_ↁ
ಆ_ಆ
ಊ_ಊ
ಹ_ಹ
ㅎ_ㅎ
【•】_【•】[woah]
(ு८ு_ .:)
(づ。◕‿‿◕。)づ [hug]
(/◔ ◡ ◔)/ [hug]
٩(̾●̮̮̃̾•̃̾)۶ [celebrate]
\(• ◡ •)/ [celebrate]
\( ゚◡゚)/ [celebrate]
⊂(◉‿◉)つ [wave]
ح˚௰˚づ [wave]
╚(•⌂•)╝ [stop]
☜-(ΘLΘ)-☞ [which way?]
☜。◕‿◕。☞
(✌゚∀゚)☞ [point and laugh]
щ(゚Д゚щ) [Dear god why‽]
ლ(ಠ_ಠ ლ) [settle down]
◖|◔◡◉|◗ [HURR DURR]
( ‘-’)人(゚_゚ ) [high-five]
( _)=mm=(^_^ ) [brofist]
(>'o’)> ♥ <('o’<)
⎝⏠⏝⏠⎠ [content]
( ´_⊃`)[content]
(Ō_ƆŎ) [eyebrow raised]
≖_≖ [I see what you did there…]
\|  ̄ヘ ̄|/ [praise me]
̿’ ̿’\̵͇̿̿\з=(•̪●)=ε/̵͇̿̿/’̿’̿ [big guns]
< ('o'<) ( '-’ ) (>‘o’)> v( ‘.’ )v < (' .' )> < ('.'<) ( '.’ ) (>‘.’)> v( ‘.’ )v < (' .' )> [dancing]
♪┏(・o・)┛♪┗ ( ・o・) ┓♪┏ ( ) ┛♪┗ (・o・ ) ┓♪┏(・o・)┛♪ [singing/dancing]
Ƹ̵̡Ӝ̵̨̄Ʒ [butterfly]
/╲/\╭ºoꍘoº╮/\╱\ [spider]
(* ・(エ)・ *) [pedobear?]
(\/) (°,,°) (\/) [WOOPwoopwoopwoopwoop]
⊛ठ̯⊛ [bicycle… face?]
ತಟತ [buttface]
’;‘ [scream]
/:€ [Myth busted!]
˚⌇˚ [squirm]
ಈ_ಈ [eyes tied shut] (wat?)
ⓧ_ⓧ [x]
⨂_⨂ [x]
✖_✖ [x]
×̯× [x]
‹•.•›
•ﺑ• [oooh]
(० ्०)
ôヮô
¢‿¢
!⑈ˆ~ˆ!⑈
•(⌚_⌚)• [late]
(▰˘◡˘▰)
۹ↁﮌↁ
乂◜◬◝乂
ತ_ಎತ
ಠﭛಠ [goatee]
⏠⏝⏠
⇎_⇎
흫_흫
句_句
໖_໖
༺‿༻
ಠ , ಥ
१✌◡✌५
१|˚–˚|५
โ๏௰๏ใ ื
◜㍕◝
◷_௰◴
◎ܫ◎
(˚ㄥ_˚)
(˚இ˚)
ộ_ộ
◘_◘ 
◙‿◙
δﺡό
⊂•⊃_⊂•⊃
ح˚ᆺ˚ว
❂‿❂ 
❐‿❑
☾˙❀‿❀˙☽ 
(ΘL_Θ)
●¿_●
《〠_〠》 [f*ck yeah]
حᇂﮌᇂ) [f*ck yeah]
ಠ︵ಠ凸 [f* u]
┌∩┐(>_<)┌∩┐ [f* u]
‹^› ‹(•¿•)› ‹^› [f* u]
✄————- [scissors]
╰▄︻▄╯ [YEAAAAAAHHH]
▄︻┻┳═一 [rifle]
(̅_̅_̅_̅(̅_̅_̅_̅_̅_̅_̅̅_̅()ڪے [cigarette]
( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅) [band-aid]
ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡ [house]
lıllı ((((|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|)))) ıllı [boombox]
┣▇▇▇═── [needle]
┣▇▇▇═─────────── [*whimper]
╰☆╮ [spinning killblade]
ϟ [Potter]
ಠ_ಠ
<script>
jQuery( document ).ready(function($){
	$(document).on('click','.elementor-location-popup a', function(event){
		elementorProFrontend.modules.popup.closePopup( {}, event);
	})
});
</script>
//******--- Remove Font Awesome ---*****
//===============================
add_action( 'elementor/frontend/after_register_styles',function() {
	foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
		wp_deregister_style( 'elementor-icons-fa-' . $style );
	}
}, 20 );
try {
  let hello = prompt("Type hello");
  if (hello !== 'hello'){
    throw new Error("Oops, you didn't type hello");
  }
}
catch(e) {
  alert(e.message);
}
finally {
  alert('thanks for playing!');
}
split_col = pyspark.sql.functions.split(df['my_str_col'], '-')
df = df.withColumn('NAME1', split_col.getItem(0))
df = df.withColumn('NAME2', split_col.getItem(1))
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
    })
});
pipeline {
    stages { ... }
    post {
       // only triggered when blue or green sign
       success {
           slackSend(channel: 'alerts-testing', color: 'good', message: ":party_parrot: NOTIFICATION: NEW RELEASE ${newRelease} WILL BE CREATED AUTOMATICALLY :party_parrot:")
       }
       // triggered when red sign
       failure {
           slackSend(channel: 'alerts-testing', color: 'RED', message: ":alarm_clock: NOTIFICATION: NEW RELEASE ${newRelease} WITH SOME FAILURE :alarm_clock:")
       }
       // trigger every-works
       always {
           slackSend ...
       }
    }
}
SELECT Id, ContentDocumentId, LinkedEntityId, ShareType, Visibility 
FROM ContentDocumentLink 
WHERE ContentDocumentId IN (SELECT Id FROM ContentDocument)
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}"));
def when(predicate, when_true):
  return lambda x: when_true(x) if predicate(x) else x
  
EXAMPLES
double_even_numbers = when(lambda x: x % 2 == 0, lambda x : x * 2)
double_even_numbers(2) # 4
double_even_numbers(1) # 1
def unfold(fn, seed):
  def fn_generator(val):
    while True: 
      val = fn(val[1])
      if val == False: break
      yield val[0]
  return [i for i in fn_generator([None, seed])]
  
  
EXAMPLES
f = lambda n: False if n > 50 else [-n, n + 10]
unfold(f, 10) # [-10, -20, -30, -40, -50]
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();
        }
    }
}
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.util.*;
import java.io.*;

class Solution
{
    public static void main (String[] args) 
    {
        int arr[] = new int[]{50,20,40,60,10,30};
        
        int n = arr.length;
        iSort(arr,n);
        
        for(int x:arr)
            System.out.print(x+" ");    // OUTPUT : 10 20 30 40 50 60 
        
    }
    
    static void iSort(int arr[],int n)
    {
        for(int i=1;i<n;i++){
            int key = arr[i];
            int j=i-1;
            while(j>=0 && arr[j]>key){
                arr[j+1]=arr[j];
                j--;
            }
            arr[j+1]=key;
        }
    }
}
// Efficient Code :

import java.util.*;
import java.io.*;

class Solution
{
    public static void main (String[] args) 
    {
        int a[] = new int[]{10,15,20,40};
        int b[] = new int[]{5,6,6,10,15};
        
        int m = a.length;
        int n = b.length;
        merge(a,b,m,n);
    }
    
    static void merge(int a[], int b[], int m, int n)
    {
        int i=0,j=0;
        while(i<m && j<n){
            if(a[i]<b[j])
                System.out.print(a[i++]+" ");
            else
                System.out.print(b[j++]+" ");
        }
        while(i<m)
            System.out.print(a[i++]+" ");
        while(j<n)
            System.out.print(b[j++]+" ");    
    }
}








// Naive Code :

import java.util.*;
import java.io.*;

class Solution
{
    public static void main (String[] args) 
    {
        int a[] = new int[]{10,15,20,40};
        int b[] = new int[]{5,6,6,10,15};
        
        int m = a.length;
        int n = b.length;
        merge(a,b,m,n);
        
    }
    
    static void merge(int a[], int b[], int m, int n){
    
        int[] c=new int[m+n];
        for(int i=0;i<m;i++)
            c[i]=a[i];
        for(int j=0;j<n;j++)
            c[j+m]=b[j];
        
        Arrays.sort(c);
        
        for(int i=0;i<m+n;i++)
            System.out.print(c[i]+" ");
    }
}
import java.util.*;
import java.io.*;

class Solution
{
    public static void main (String[] args) 
    {
        int a[] = new int[]{10,5,30,15,7};
	    int l=0,r=4;
        
        mergeSort(a,l,r);
    	for(int x: a)
	        System.out.print(x+" ");    // OUTPUT : 5 7 10 15 30 
        
    }
    
    static void merge(int arr[], int l, int m, int h){
    
        int n1=m-l+1, n2=h-m;
        int[] left=new int[n1];
        int[]right=new int[n2];
        
        for(int i=0;i<n1;i++)
            left[i]=arr[i+l];
        for(int j=0;j<n2;j++)
            right[j]=arr[m+1+j];
            
        int i=0,j=0,k=l;
        while(i<n1 && j<n2){
            if(left[i]<=right[j])
                arr[k++]=left[i++];
            else
                arr[k++]=right[j++];
        }
        while(i<n1)
            arr[k++]=left[i++];
        while(j<n2)
            arr[k++]=right[j++];    
    }
    
    static void mergeSort(int arr[],int l,int r){
        if(r>l){
            int m=l+(r-l)/2;
            mergeSort(arr,l,m);
            mergeSort(arr,m+1,r);
            merge(arr,l,m,r);
        }
    }
}
import json
import requests

apikey = '43979f1b-f353-4842-ad8a-ecb2735f3b71'

headers = {
    'X-CMC_PRO_API_KEY' : apikey,
    'Accepts' : 'application/json'
}

params = {
    'start' : '1',
    'limit' : '5',
    'convert' : 'USD'
}

url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest'

json = requests.get(url, params=params, headers=headers).json()

coins = json['data']

for coin in coins:
    print(coin['symbol'], coin['quote']['USD']['price'])
- git init         #Initialise locat repositiry
- git add <file>   #Add files to index
- git status       #Check status of working tree
- git commit       #Commit changes in index
- git push         #Push to remote repository
- git pull         #Pull latest from remote repository
- git clone        #Clone repository into a new directory
##-----------------------------------------------------------------------------
1. Configure
- git config --global user.name 'Ian Horne'
- git config --global user.email 'ian@ihorne.com'
##-----------------------------------------------------------------------------
2. File to staging
- git add <file name> #Add file 
- git rm <file name>  #Remove file
- git add *.py        #Add all .py files to staging area
- git add .           #Add all files in directory to staging area
##-----------------------------------------------------------------------------
3. Commit staging area to your local repository
- git commit -m "your comments"
##-----------------------------------------------------------------------------
4. Ignore file
- create .git ignore file <touch .gitignore> 
- enter file or folder into .gitignore file to exclude it from the repository 
   -Add file           - <file.ext>
   -Add directory      - </dirname> 
   -Add all text files - <*.txt>
##-----------------------------------------------------------------------------
5. Branches - https://www.atlassian.com/git/tutorials/using-branches
- git branch <branch_name>    #Create branch
- git checkout <branch_name>  #move to branch
- git add <filename>          #add file change to branches
- git commit -m "comments"    #commit file and add comments
- git checkout <master>       #move to main branch
- git merge <branch name>     #merge branch into current branch location
- git push                    #push branch to hub
- git branch -d <branch>      #delete branch

##-----------------------------------------------------------------------------
6. Remove repositories
- Create new repository
- git remote                #list all remote repositories
- git remote add origin https://github.com/Ianhorne73/WageReport.git
- git push -u origin master
##-----------------------------------------------------------------------------
Future workflow
- change file
- git add .
- git push
##-----------------------------------------------------------------------------
Clone repository 
- git clone <get link from GIT hub>  #Clone repository from GIT Hub
- git pull                           #Get latest updates
select Opportunity__r.Country_of_Ownership__c,CALENDAR_MONTH(Transaction_Allocation__c.Close_Date__c)themonth,
  CALENDAR_YEAR(Transaction_Allocation__c.Close_Date__c)theyear, COUNT_DISTINCT(Opportunity__r.Id) The_Count, sum(Opportunity__r.Ask_Amount__c) amount

from Transaction_Allocation__c

where 
(Transaction_Allocation__c.Close_Date__c  > 2022-03-31 AND Transaction_Allocation__c.Close_Date__c  < NEXT_N_DAYS:1) 
AND
(Transaction_Allocation__c.Stage__c IN ('Posted','Refunded','Failed','Refund','Reversal')
AND
((
Opportunity__r.RecordTypeId IN ('012w00000006jGy')
 AND
Opportunity__r.Date_Recurring_Donation_Established__c  > 2022-03-31
 
)
OR
(Opportunity__r.RecordTypeId IN ('0122X000000ie1A') 
AND
Opportunity__r.Direct_Regular_Donor_Start_of_FY__c = False))
 
AND
Transaction_Allocation__c.GL_Code__c IN ('50030','50090')
)
 

Group by 
Opportunity__r.Country_of_Ownership__c,CALENDAR_MONTH(Transaction_Allocation__c.Close_Date__c),
  CALENDAR_YEAR(Transaction_Allocation__c.Close_Date__c)
import os

# https://github.com/serpapi/google-search-results-python
from serpapi import GoogleSearch

params = {
  "engine": "google",
  "q": "cute animals",
  "tbm": "nws",
  "api_key": os.getenv("API_KEY"),
}

search = GoogleSearch(params)

pages = search.pagination()

for result in pages:
  print(f"Current page: {result['serpapi_pagination']['current']}")

  for news_result in result["news_results"]:
      print(f"Title: {news_result['title']}\nLink: {news_result['link']}\n")
# Open the terminal in the app dyno in Heroku

heroku run bash

 

# We may then run the seed file

node bin/seed.js
import org.json.*;


JSONObject obj = new JSONObject(" .... ");
String pageName = obj.getJSONObject("pageInfo").getString("pageName");

JSONArray arr = obj.getJSONArray("posts");
for (int i = 0; i < arr.length(); i++)
{
    String post_id = arr.getJSONObject(i).getString("post_id");
    ......
}
<p id="copyrightyear"></p>

<script>
   document.getElementById('copyrightyear').innerHTML
</script>
# get "/articles?page=2"
request.original_url # => "http://www.example.com/articles?page=2"
<link rel="stylesheet" href="https://speed-cl.netlify.app/components.css" />
<p id="date-stamp">Sat Dec 14 2019 16:58:20 GMT+0500 (Pakistan Standard Time)</p>

<script>
        var dateStamp = document.getElementById("date-stamp");
        var date = dateStamp.innerHTML;
        var date2 = date.substr(4, 17);
        dateStamp.innerHTML = date2;
    
</script>
<!--logo and text (title) -->
<nav class="navbar navbar-light bg-light">
  <a class="navbar-brand" href="#">
    <img src="/assets/startupcache_logo.svg" width="90" height="90" class="d-inline-block align-top" alt="">
    Startup Cache
  </a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
  	<ul class="navbar-nav">
    	<li class="nav-item active">
        	<a class="nav-link" id="about-link" href="/templates/about.html">About</a>
        </li>
    </ul>
  </div>
</nav>
from html.parser import HTMLParser

class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print("Encountered a start tag:", tag)
    def handle_endtag(self, tag):
        print("Encountered an end tag :", tag)
    def handle_data(self, data):
        print("Encountered some data  :", data)

parser = MyHTMLParser()
parser.feed('<html><head><title>Test</title></head>'
            '<body><h1>Parse me!</h1></body></html>')
           
<!DOCTYPE html>
<html>
<head>
    <title>Demo: Lazy Loader</title>
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <style>
        #myScroll {
            border: 1px solid #999;
        }

        p {
            border: 1px solid #ccc;
            padding: 50px;
            text-align: center;
        }

        .loading {
            color: red;
        }
        .dynamic {
            background-color:#ccc;
            color:#000;
        }
    </style>
    <script>
		var counter=0;
        $(window).scroll(function () {
            if ($(window).scrollTop() == $(document).height() - $(window).height() && counter < 2) {
                appendData();
            }
        });
        function appendData() {
            var html = '';
            for (i = 0; i < 10; i++) {
                html += '<p class="dynamic">Dynamic Data :  This is test data.<br />Next line.</p>';
            }
            $('#myScroll').append(html);
			counter++;
			
			if(counter==2)
			$('#myScroll').append('<button id="uniqueButton" style="margin-left: 50%; background-color: powderblue;">Click</button><br /><br />');
        }
    </script>
</head>
<body>
    <div id="myScroll">
        <p>
            Contents will load here!!!.<br />
        </p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
        <p >This is test data.<br />Next line.</p>
    </div>
</body>
</html>
// 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);
}
// 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 };
  }
}
<!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>
<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>
<header class="navbar-wrapper d-flex align-center justify-around box-shadow-lg">
    <h1 class="brand headline-lg p-4">Brand</h1>
    <div class="search-box d-flex align-center justify-between my-4 w-50">
        <input type="text" class="search-input w-100 p-2 m-2 text-sm" placeholder="Search for products..." required />
        <button type="submit" class="btn btn-icon p-4">
            <i class="fas fa-search text-md"></i>
        </button>
    </div>
    <ul class="nav-links d-flex align-center">
        <li>
            <button class="btn btn-primary rounded-sm text-sm p-4">Login</button>
        </li>
        <li class="p-relative text-md icon-badge-wrapper m-4">
            <i class="fas fa-shopping-cart"></i>
            <span class="badge icon-badge-position text-sm font-wt-bold rounded-full p-absolute">5</span>
        </li>
        <li class="p-relative text-md icon-badge-wrapper m-4">
            <i class="fas fa-heart"></i>
            <span class="badge icon-badge-position text-sm font-wt-bold rounded-full p-absolute">7</span>
        </li>
    </ul>
</header>
star

Fri Dec 04 2020 20:33:23 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/51733044/flutter-blinking-button

@Kenana #dart

star

Sun Jul 04 2021 12:00:39 GMT+0000 (Coordinated Universal Time) https://github.com/Temidtech/Flutter-Cheat-Sheet/blob/master/README.md

@putrandasky #dart #flutter

star

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

@viewsource #dart

star

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

@abir_hasnat95 #flutter #dart

star

Thu Aug 18 2022 07:19:21 GMT+0000 (Coordinated Universal Time)

@ClemensBerteld #pyproj #python #database #path

star

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

@ianh #python #datetime #pandas

star

Wed Apr 01 2020 10:09:44 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/5701305/how-to-get-all-imports-defined-in-a-class-using-java-reflection

@SunLoves #java #java #reflection #dependencies

star

Tue Aug 09 2022 20:11:11 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/permutations/submissions/

@bryantirawan #python #depth #first #search #recursive #neetcode

star

Tue Mar 31 2020 05:32:45 GMT+0000 (Coordinated Universal Time)

@EnjoyByte #python #python #dictionary #mergedictionary #dict

star

Mon Jun 20 2022 10:05:00 GMT+0000 (Coordinated Universal Time) https://www.codechef.com/ide?itm_medium

@rk5002212 #disctionary #sorting

star

Wed Dec 30 2020 19:26:24 GMT+0000 (Coordinated Universal Time)

@lewiseman #django,python,django #django

star

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

@alexactivate #docker

star

Wed Jun 16 2021 13:49:40 GMT+0000 (Coordinated Universal Time) http://wrttn.me/30dbfd/

@hisam #unicode #emoticons #dongers

star

Fri Jan 10 2020 20:51:27 GMT+0000 (Coordinated Universal Time) https://github.com/Microsoft/vscode

@mishka #microsoft #typescript #editor #opensource

star

Wed May 12 2021 22:36:52 GMT+0000 (Coordinated Universal Time)

@Alz #php #wordpress #elementor

star

Wed Apr 16 2025 10:08:26 GMT+0000 (Coordinated Universal Time) https://www.shoviv.com/blog/how-to-migrate-sharepoint-site-to-another-site/

@petergrew #english

star

Wed Jan 01 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://codeburst.io/learn-how-to-handle-javascript-errors-with-try-throw-catch-finally-83b4f9ef8c6f

@new_roman11 #javascript #errors #howto

star

Wed Feb 24 2021 17:36:03 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/39235704/split-spark-dataframe-string-column-into-multiple-columns

@lorenzo_xcv #pyspark #spark #python #etl

star

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

@ExplodeMilk #typescript #express #socketio

star

Thu Jan 21 2021 20:06:06 GMT+0000 (Coordinated Universal Time)

@abovetheroar #qgis #fieldcalculator

star

Tue Oct 15 2024 23:18:06 GMT+0000 (Coordinated Universal Time) https://www.linkedin.com/posts/davidmasri_%F0%9D%90%8D%F0%9D%90%9E%F0%9D%90%B0-%F0%9D%90%AC%F0%9D%90%AE%F0%9D%90%A9%F0%9D%90%9E%F0%9D%90%AB-%F0%9D%90%A1%F0%9D%90%9A%F0%9D%90%9C%F0%9D%90%A4-%F0%9D%90%9F%F0%9D%90%A8%F0%9D%90%AE%F0%9D%90%A7%F0%9D%90%9D-ever-activity-7251940478143664129-YeU9?utm_source=share&utm_medium=member_desktop

@dannygelf #flow #salesforce #slds

star

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

@lewiseman #flutter

star

Sat Jan 11 2020 20:54:48 GMT+0000 (Coordinated Universal Time) https://www.30secondsofcode.org/python/s/when/

@dry_toasts #python #function

star

Fri Jan 10 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://www.30secondsofcode.org/python/s/unfold/

@peterents #python #lists #function

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

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

Tue Feb 08 2022 14:56:44 GMT+0000 (Coordinated Universal Time)

@Uttam #java #gfg #geeksforgeeks #lecture #sorting #insertionsort

star

Tue Feb 08 2022 15:00:15 GMT+0000 (Coordinated Universal Time)

@Uttam #java #gfg #geeksforgeeks #lecture #sorting #merge #sortedarrays

star

Tue Feb 08 2022 15:08:17 GMT+0000 (Coordinated Universal Time)

@Uttam #java #gfg #geeksforgeeks #lecture #sorting #mergesort

star

Thu Mar 17 2022 17:43:19 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=iIGNhBcj4zs

@Taylor #python #get #requests

star

Mon Oct 26 2020 04:28:26 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=SWYqp7iY_Tc

@ianh #git

star

Wed Jun 01 2022 11:22:06 GMT+0000 (Coordinated Universal Time)

@Matt_Stone #globalkpi

star

Mon May 03 2021 14:16:22 GMT+0000 (Coordinated Universal Time) https://replit.com/@DimitryZub1/Scrape-Google-News-with-Pagination-python-serpapi

@ilyazub #webscraping #googlenews #serpapi

star

Mon Jun 14 2021 12:02:44 GMT+0000 (Coordinated Universal Time)

@hisam #heroku #seed #nodejs

star

Thu Dec 26 2019 16:01:30 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2591098/how-to-parse-json-in-java

@mishka #java #howto #json

star

Fri Dec 27 2019 10:44:21 GMT+0000 (Coordinated Universal Time) https://dev.to/vivekanandpadala/javascript-snippet-for-dynamically-updating-footer-copyright-year-3cdp

@goblindoom95 #html #javascript #howto

star

Tue Dec 31 2019 19:00:00 GMT+0000 (Coordinated Universal Time) https://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-original_url

@vasquezthefez #howto #rubyonrails #webdev #interviewquestions

star

Mon Feb 21 2022 11:28:30 GMT+0000 (Coordinated Universal Time)

@artistole #htm

star

Sat Dec 14 2019 20:36:19 GMT+0000 (Coordinated Universal Time)

@mishka #html #javascript

star

Tue May 05 2020 16:14:10 GMT+0000 (Coordinated Universal Time) https://madeusblack.github.io/projects/Library-js/index.html

@madeusblack #html

star

Sat Jun 13 2020 19:27:29 GMT+0000 (Coordinated Universal Time)

@_ferasbaig #html

star

Thu Jan 02 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://docs.python.org/3.4/library/html.parser.html

@_clones_jones_ #html #python #xhtml

star

Mon Jun 15 2020 11:09:15 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/14035180/jquery-load-more-data-on-scroll

@Hamza #html

star

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

@markf_raindrop #javascript #jquery #php #html

star

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

@mmerkley #html

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

Thu Feb 10 2022 10:16:58 GMT+0000 (Coordinated Universal Time)

@viresh #html

Save snippets that work with our extensions

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