Example gist for Cacher

Example gist for Cacher
public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}

loop - meta query mit cpt

$argsref = array(
                'post_type' => 'referenz',
                'posts_per_page' => -1,
                'meta_query' => array(
                    'key'     => 'kp_referenz_featured', //checkbox
                    'value'   => '1' // check if true
                )
            );

Search for tables with given name

`SHOW TABLES FROM `XXX` WHERE `Tables_in_XXX` LIKE '%denied%';`

Override templates for Divi Staff WordPress plugin

# How to override templates for Divi Staff WordPress plugin This code snippet is useful when you want to customize the HTML output and PHP output of the [Divi Staff plugin](https://www.montereypremier.com/product/divi-staff/) by Monterey Premier. It will help you override the plugin templates by using your theme templates. I did not find ## What templates? Divi Staff has 3 templates, similar to any custom post type: - staff single (i.e. the post) - staff taxonomy (i.e. the category) - staff archive (i.e. the listing) ## How to override the templates? Here's how: 1. copy the folder ` /templates/ ` from the Divi Staff plugin and drop into your theme. 2. copy lines 63-75 in ` divi-staff.php`, and add to your ` functions.php ` file. Be sure to update each filter name (i.e. single_staff_template) with your theme prefix (i.e. jennywrenchildtheme_single_staff_template). For example (lines 63-75):
//* Override Divi Staff plugin templates
// @link /plugins/divi-staff.php
// Note: the plugin_dir_path(FILE) does go to the theme file

add_filter('template_include', 'jennywren_single_staff_template');
function jennywren_single_staff_template( $template ) {
    if( is_singular('staff') ) {
        $theme_files = array();
        $exists_in_theme = locate_template($theme_files, false);
        if( $exists_in_theme != '' ) {
             return $exists_in_theme;
        } else {
            return plugin_dir_path(FILE) . 'templates/single-staff.php';
        }
    }
    return $template;
}

add_filter('template_include', 'jennywren_staff_template');
function jennywren_staff_template( $template ) {
    if( is_post_type_archive('staff') ) {
        $theme_files = array();
        $exists_in_theme = locate_template($theme_files, false);
        if( $exists_in_theme != '' ) {
            return $exists_in_theme;
        } else {
        return plugin_dir_path(FILE) . 'templates/archive-staf

Gravity Perks // Populate Anything // Populate User Role

<?php
/**
 * Gravity Perks // Populate Anything // Populate User Role
 * http://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
add_filter( 'gppa_process_template', function( $value, $field, $template, $populate, $object, $object_type, $objects ) {
	if( $template == 'role' && is_a( $object, 'WP_User' ) ) {
		$value = implode( ', ', $object->roles );
	}
	return $value;
}, 10, 7 );

Git Command line Fundamental

### Git Download 
[Git Download link](https://git-scm.com/)

### Check Version
```bash
    git --version
```
### Set Config file username and email
```bash
git config --global user.name "Dibaloke Chanda"
git config --global user.email "dibaloke66@gmail.com"
```
### See Config file
```bash
git config --list
```
### Help Commmand
```bash
git help onfig
git config --help
```
### Intialize Repo
```bash
git init
```

### Check Status of Staging Area
```bash
git status
```
### Check log of commit with message
```bash
git log
```
### Add all files to staging area
```bash
git add -A
```
### Add Specific files to staging area
```bash
git add m.py hello.py pubspec.yml .gitignore

```
### Reset or pull  all files from staging area
```bash
git reset
```
### Reset or pull specific files from staging area
```bash
git reset m.py hello.py pubspec.yml .gitignore
```
###  Commit files from staging area with message
```bash
git commit -m "Intial Commit"
```
### Clone Remote Repo to current directory
```b

jquery-toast by Kamran Ahmed

jquery-toast by Kamran Ahmed
https://www.npmjs.com/package/jquery-toast-plugin
https://kamranahmed.info/toast

// steps to follow before installing jquery toast plugin
1) npm install jquery-toast-plugin

// after running the above command include the css file location and js file location in the angular.json file.
2)"styles": [
              "node_modules/jquery-toast-plugin/dist/jquery.toast.min.css",
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "src/styles.scss"
            ],

3)  "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/popper.js/dist/umd/popper.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js",
              "node_modules/jquery-toast-plugin/dist/jquery.toast.min.js"
            ]            
            
            
// now you are ready to write the code in your ts file to show notification.
//place this in a button click listner to show belo toast.
// this is the default toast check the repo f

grooming-260319

Matrix YouTube Video Background

YouTube matrix background ie - https://www.woodlandswellness.com/test, http://cloud.madebyspeak.com/351ad3
<div class="video-container">
    <div id="ytplayer"></div>
    
    
    <video poster="{{ Module.FieldValues.MobilePoster }}" id="bgvid" playsinline autoplay muted loop>
		<source src="{{ Module.FieldValues.MobileVideo }}" type="video/mp4">
	</video>
</div>

<div class="play">
    <span>
        <a class="video-launch" rel="shadowbox;height=450;width=800" href="https://www.youtube.com/embed/{{ Module.FieldValues.Video }}">
            <img class="video-play throb" style="height:75px" src="SiteFiles/2435/css/images/play-button.svg" alt="Play video" />
        </a>
    </span>
</div>

Matrix Video Background

YouTube matrix background ie - https://www.woodlandswellness.com/test, http://cloud.madebyspeak.com/351ad3
<div class="video-container">
    <div id="ytplayer"></div>
    
    
    <video poster="{{ Module.FieldValues.MobilePoster }}" id="bgvid" playsinline autoplay muted loop>
		<source src="{{ Module.FieldValues.MobileVideo }}" type="video/mp4">
	</video>
</div>

<div class="play">
    <span>
        <a class="video-launch" rel="shadowbox;height=450;width=800" href="https://www.youtube.com/embed/{{ Module.FieldValues.Video }}">
            <img class="video-play throb" style="height:75px" src="SiteFiles/2435/css/images/play-button.svg" alt="Play video" />
        </a>
    </span>
</div>

Add new SSH identity

ssh-agent $(ssh-add ~/.ssh/id_rsa)

Test snippet

# Markdown - With bullet - Bullet
private selectSnippetInList(snippet: Snippet) {
  this.appEventsService.push({
    type: AppEventType.SelectSnippet,
    data: { snippet }
  });
}

Past and/or Upcoming Events Shortcode for The Events Calendar by Modern Tribe WordPress plugin

Past and/or Upcoming Events Shortcode for The Events Calendar by Modern Tribe WordPress plugin
//======================================================================
// Shortcode for The Events Calendar by Modern Tribe WordPress plugin
//======================================================================

// Display events with event date
// @link https://support.theeventscalendar.com/666307-Using-tribe_get_events
// @link https://codex.wordpress.org/Class_Reference/WP_Query
// Documentation at bottom of this file

//* Add Shortcode [my_events cat='herndon-gallery' offset='1' limit='3' featured='yes' past='yes']
add_shortcode( 'my-events', 'my_events_function' );
function my_events_function( $atts ){

	// Add shortcode attributes
    $a = shortcode_atts( array(
        'cat' => '',
        'offset' => 0,
        'limit' => -1,
        'featured' => '',
        'past' => '',
    ), $atts );
    
	// Variables for the attributes
    $my_events_cat = "{$a['cat']}";
    $my_events_offset = "{$a['offset']}";
    $my_events_limit = "{$a['limit']}";
    $my_events_featured = "{$a[

Gravity Perks // Copy Cat // Copy Product Value (Exclude Price)

<script type="text/javascript">
 
gform.addFilter( 'gppc_copied_value', function( value, $elem, data ) {
  // Update "1" to the ID of the field being copied to.
	if( data.target == 1 && value ) {
		value = value.split( '|' )[0];
	}
	return value;
} );
 
</script>

CSV String -> Multiline String

let csv = 'apple, , oranges,,bananas';
let multiline = csv.split(',').map(v => v.trim()).filter(Boolean).join('\n');

docker with prisma

# Init
https://www.prisma.io/docs/get-started/01-setting-up-prisma-new-database-JAVASCRIPT-a002/

# Work process
in prisma.yml  
set endpoint as
```
endpoint: http://localhost:4466
```

```
cd ./prisma
prisma deploy
```
this will hook `seeding` automatically too

# Import and Export
[doc](https://www.prisma.io/docs/prisma-cli-and-configuration/data-import-and-export-jsw9/)  
[how to](https://www.prisma.io/tutorials/data-import-and-export-with-prisma-cs03/)