working on it ...

Filters

Explore Public Snippets

Sort by

Found 2.9M snippets

    public by simonwalker modified Wednesday at 12:02:37 PM  152  1  3  0

    Magento 2 Call For Price Extension By FME

    Magento 2 Call for price extension allows you to hide product prices from selected user groups or store views. You can replace the price option with ‘Get a quote’ popup, an image, or an alternative page. Subsequently, you can hide other Calls-to-action like ‘Add to Cart’, ‘Add to Wishlist’, and ‘Add to compare.’ Set conditions to restrict the price
    // code here 						

    public by PBMCube modified Jan 10, 2019  34  0  3  1

    Game Box Prototype

    command combinations Description: Quickly create operational games using simple box graphics from Phaser3 shapes (v3.13.x). This test game mechanics for enjoyment. Final Artwork added to game mechanisms, prototypes and mechanics as the final pipeline product phase.
    // ============
    //Example 4.1: Prototyping Graphics begins
    // ============
    //create a character avatar using the box prototype method 
    player = box({who: this, whereX: 150, whereY: 100,length:32, width:32, color: 0x0000FF,border: 0xFFFFFF});
    this.physics.add.existing(player);
    player.body.velocity.x = 10; //see update function
    player.body.velocity.y = 50;
    console.log("Stationary Blue character avatar created as 'player' variable.");
    // ------------  
    // OR the direct method using either rectangle or graphics
    //    and set movement velocities. 
    var avatar =  this.add.rectangle(100, 100, 32, 32, 0x0000FF).setStrokeStyle(5, 0x3399CC);
    console.log("Moving Blue character avatar created as 'player' variable.");
    var graphics = this.add.graphics({ fillStyle: { color: 0xFF0000 } });
    graphics.lineStyle(10,0xFF9900,0);
    graphics.strokeRect(100, 100, 32, 32);
    	
    //non-controlled movement (usage AI bot; see Chapter 6)
    graphics.fillRectShape(avatar);
    this.physics.add.existing(avatar);
    avatar.body.velocity.x = 50;
    avatar.body.velocity.y = 10;
    //non-controlled movement (usage AI bot; see Chapter 6)
    this.physics.add.existing(graphics);
    graphics.body.velocity.x = 50;
    graphics.body.velocity.y = 50;
    console.log("Moving Red avatar created as 'avatar' variable.\n Movement velocity set.");
    // ------------
    //create an opponent - direct method 
    var monster = this.add.rectangle(180, 60, 32, 32, 0x00FF00).setStrokeStyle(5, 0xFF9900);
    console.log("Green monster avatar created as 'monster' variable.");
    //Example 4.1: ends
    // ============
    

    public by PBMCube modified Jan 10, 2019  23  0  3  1

    Scene Preload an Image

    command format: Example:this.load.image("key", "path"); Description:Use this in the scene.preload function. .png are the default images. You can also set the "base URL"
    // ============
    // Example 3.4: Additional Phaser Properties begins
    // ============
    // remote URL to game assets
    // Cross-origin resource sharing (CORS)
    	this.load.setCORS = 'anonymous';
    // Setting base URL path
    	this.load.setBaseURL('http://makingbrowsergames.com/p3devcourse/_p3demos/imgages/');
    // Preload a gfx asset
    	this.load.image("face", "face.png");
    	

    public by PBMCube modified Jan 10, 2019  33  0  3  1

    Doors as Buttons

    Dungeon doorways should be both clickable and sense collisions.
    //Phaser III - clicking on a doorway  
    // ============
    // Example 4.6:  Doors as Buttons
    // ============
    // Creating door rectangles; review console in this experiment  
    //placed on a wall with 2px extended into the room
    doorN = this.add.rectangle(35,0,60,18,0x000000)  
            .setInteractive()  
            .setOrigin(0);  
    						

    public by PBMCube modified Jan 10, 2019  37  1  3  1

    Game Config File

    This is a config file example to pass into the Phaser.Game. It is a barebones Phaser3 configuration object
    var config = {
            type: graphics_mode,
            width: game_width,
            height: game_height,
            parent: 'div-tag-name',
            scene: [nameOfScene]
        };											

    public by PBMCube modified Jan 10, 2019  20  0  3  1

    Global Game Object

    Assigning a global namespace variable with delegation into Phaser.Game
    var game = new Phaser.Game(config);

    public by sjschmalfeld modified Dec 31, 2018  510  3  4  0

    SQL Duplicates

    WITH cte AS
    (SELECT *, ROW_NUMBER() OVER (PARTITION BY col1, col2, col3, col4 ORDER BY (SELECT 0)) AS DuplicateRowNumber
        FROM table
    )
    SELECT FROM cte WHERE DuplicateRowNumber > 1
    
    
    or----
    
    WITH cte as
    (SELECT PEOPLE.*, Loan.LoanID, ROW_NUMBER() OVER (PARTITION BY SocialSecurityNo ORDER BY SocialSecurityNo) AS DuplicateRowNumber
    FROM people INNER JOIN LOAN ON FK_PeopleID=PeopleID WHERE ISNULL(SocialSecurityNo,'') <> '' AND SocialSecurityNo <> '--' AND SocialSecurityNo <> '000-00-0000' AND loan.Status='active' )
    
    SELECT * INTO #TEMP99 FROM CTE WHERE cte.DuplicateRowNumber > 1
    
    SELECT *,b.SocialSecurityNo FROM dbo.Loan 
    	INNER JOIN (SELECT PeopleID,SocialSecurityNo FROM PEOPLE WHERE SocialSecurityNo	 
    							IN (SELECT SocialSecurityNo FROM #temp99)) b 
    	ON B.PeopleID=LOAN.FK_PeopleID
    	WHERE LOAN.Status='ACTIVE'
    
    DROP TABLE #TEMP99  
    
    
    -- Another way
    	--GET RID OF #NewAddressCandidates ADDESSES ALEADY IN THE ADDRESS TABLE
    	DELETE FROM #NewAddressCandidates WHERE EXISTS (
    	SELECT t.[Address1] 
    				,t.Address2
    				,t.City
    				,t.[State]
    				,SUBSTRING(t.Zip,1,5) AS ZIP, 
    				SUBSTRING(t.Zip,7,4) AS ZIP4 
    		FROM #NewAddressCandidates T 
    			INTERSECT  
    		SELECT [Address1] ,[Address2],[City],[State],[Zip],ZIP4 FROM dbo.[Address])				
    		
    		
    -- Another way
    	WITH NODUP AS 
    		(SELECT  A.ADDRESS1,A.ADDRESS2,A.CITY,A.STATE,A.ZIP,A.ZIP4
    			  , row_number() OVER ( PARTITION BY  A.ADDRESS1,A.ADDRESS2,A.CITY,A.STATE,A.ZIP,A.ZIP4 ORDER BY  A.ADDRESS1,A.ADDRESS2,A.CITY,A.STATE,A.ZIP,A.ZIP4 ) AS nr
    		FROM    #NewAddressCandidates A)
    	DELETE FROM NODUP WHERE NR > 1;	
    	
    	SELECT * INTO  #UniqueNewAddresses  FROM #NewAddressCandidates WHERE EXISTS (
    	SELECT t.[Address1] 
    				,t.Address2
    				,t.City
    				,t.[State]
    				,SUBSTRING(t.Zip,1,5) AS ZIP, 
    				SUBSTRING(t.Zip,7,4) AS ZIP4 			
    		FROM #NewAddressCandidates T 
    			EXCEPT 
    		SELECT [Address1] ,[Address2],[City],[State],[Zip],ZIP4 FROM dbo.[Address])
    	
    	// Now to remove the duplicate rows, use the same table and use EXCEPT operator with an 
    	// empty result set returned by the same table	
    	// USING except operator	
    	SELECT col1,col2
      FROM DuplicateRcordTable
      EXCEPT
      SELECT col1,col2
      FROM DuplicateRcordTable WHERE 1=0
    								

    public by DunyaBernardon modified Dec 31, 2018  32  0  3  0

    py4E

    Learning to code
    // Enter here the actual content of the snippet.						
    print("hello world")
    hello world
    
    
    
    
                

    public by Magesolution modified Dec 20, 2018  43  0  2  0

    Magento 2 Advanced Reports

    Magento 2 Advanced Reports bring 8 report options for you. With this Magento extension you can easily check current/ past reports of products, customers, orders... in the back-end of your Magento site. Its vivid and modern look combined with clean code surely help you generate perfect solutions for your reporting with visual charts and tables.
    https://www.magesolution.com/magento-advanced-reports-m2.html				

    public by simonwalker modified Dec 19, 2018  41  0  3  0

    Magento 2 Customer Attributes Extension | FME

    Pursue a user experience design of the sign-up form by adding easy to answer attributes using Magento 2 Customer Attributes Extension. This extension empowers you to put 10 types of attributes on a registration form to intake data from users.Now the next thing is that you can apply validation on custom attributes to avoid errors while entering data
    // Enter here the actual content of the snippet.						
    • Public Snippets
    • Channels Snippets