Snippets Collections
// for compile error
#[derive(Debug)]
struct Rectangle {
    width: u32,
    height: u32,
    sqr_rec: () => {}
}

fn main() {
    let rect1 = Rectangle {
        width: 30,
        height: 50,
    };
    // ? tells compiler to output to console
    println!("rect1 is {:#?}", rect1);
      
    println!(
        "The area of the rectangle is {} square pixels.",
        area(&rect1)
    );
}


fn area(rectangle: &Rectangle) -> u32 {
    rectangle.width * rectangle.height
}
  
// 'Class' Method and Constructor (associated method (doesn't have self as fitst arg))
// Self = Struct Name ( Rectangle in this case)
impl Rectangle {
  fn new() -> Self {
    Self {
      width: 100,
      height: 100,
      fn sqr_rec(&self)
      fn sqr_rec(mut &self)
    }
  }
}
  
let rec1 = Rectangle::new();
let width = rec1.width;
let height = rect.height;
define('FS_METHOD', 'direct');
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true);
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "attach",
      // "processId": "${command:PickProcess}",
      "protocol": "inspector",
      "restart": true,
      "name": "Launch Programa",
      "skipFiles": ["<node_internals>/**"]
    }
  ]
}
star

Wed Jul 20 2022 22:37:05 GMT+0000 (UTC) https://doc.rust-lang.org/book/ch05-02-example-structs.html

#println #customtypes #debug
star

Wed Feb 09 2022 07:22:18 GMT+0000 (UTC) https://faq.o2switch.fr/gestion-site/debug-page-blanche-erreur-500

#php #wordpress #debug
star

Wed Nov 11 2020 12:56:36 GMT+0000 (UTC)

#json #nodejs #debug

Save snippets that work with our extensions

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