working on it ...


Explore Public Snippets

Sort by

Found 2.9M snippets

    public by simonwalker modified 8 hours ago  12  0  3  0


    Magento 2 Maintenance Mode and Coming Soon Page extension help you to preserve the interest of your visitors when your Website is going through maintenance. 
    You can enable Email subscription form on Coming Soon & Maintenance Mode, also you can add Social Media Links to engage your visitors. 
    Key Features
    1.	3 Website Modes- Live, Coming Soon, Maintenance Mode
    2.	Enable Coming Soon Page with User Sign-Up Form
    3.	Activate Maintenance Mode with Countdown Timer
    4.	Add Media to Coming Soon & Maintenance  Mode Pages
    5.	White-List Website Traffic with Respect to IP Addresses
    6.	Display Social Links to Keep Customers Engaged
    7.	Option to Allow Visitors to Access CMS Pages
    Complete Detail & Demo -

    public by simonwalker modified 9 hours ago  11  0  3  1


    // Enter here the actual content of the snippet.						
    Magento 2 Custom Registration Form Field is a feature-rich extension which allows you to add extra fields to the Sign-up form of your Website.
    You can add additional fields in just a few easy steps and also set them to mandatory or optional.
    You can add up-to 13 types of custom fields.
    •	Text Field
    •	Text Area
    •	File Upload
    •	Image Upload
    •	Date
    •	Drop Down
    •	Multiple Select
    •	Yes/No option
    •	Radio
    •	Checkboxes
    •	Text Editor
    •	Audio Upload
    •	Video Upload
    You can make fields non-editable once user entered the data. In this way you can prevent customers change their data after registration.
    Key Features
    1.	Add Unlimited Custom Fields to Registration Page
    2.	Position & Sort Fields Anywhere on Registration Form
    3.	Add Multiple-Level Dependable Fields
    4.	Make Fields Mandatory or Optional
    5.	Configure Data Input Validation for Fields
    6.	Show/Hide New Field in Registration Email & My Account
    7.	Restrict Additional Fields By Store Views
    8.	Make Field Non-Editable Once Data I Entered
    More Feature Visit-

    public by simonwalker modified Mar 19, 2019  119  1  3  0

    Magento 2 Custom Registration Fields Extension | FME

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

    public by gchimera modified Mar 18, 2019  54  0  1  0

    Show new activity

    val intent = Intent(this,

    public by ZeeRQ modified Mar 15, 2019  29  1  2  0


    // 	ULTIMATE SEO OPTIMIZER for Magento 2
    Magento 2 Ultimate SEO Optimizer extension is all in one pack of seven SEO Extensions for your store that significantly reduces your search optimization work load and cost. This Magento 2 SEO extension gives you a combination of 7 powerful tools that automate your SEO tasks such as creating:
     (1) SEO Meta tags
     (2) Image Alt tags
     (3) Rich Snippets
     (4) Sitemap
     (5) No-Follow No-Index tags
     (6) Canonical Tags
     (7) Multilingual Hreflang tags.
     This makes your online presence SEO equipped and improves your online rankings on SERPs.
    Key Features:
    •	Add Extended Google Rich Snippet Tags
    •	Handle Content Language Duplicates with Hreflang Tags
    •	Add No Index No Follow Tags to Any Page
    •	Add Canonical Tags to Prevent Duplication
    •	Auto-create SEO Meta Title, Description & Keywords
    •	Generate SEO Optimized Alt Tags for Product Images
    •	Build XML & HTML Sitemaps for Store
    To explore more about SEO Extension For Magento 2 visit following URL

    public by samuelcrockford modified Mar 14, 2019  62  1  3  0

    Centre child inside its parent - Old School Way

    How to centre a div vertically and horizontally inside its parent
    /* Center a div - The old school way*/
    .parent { /* Center my child relative to me */
      position: relative;
    .child { /* Center me inside my parent*/
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);

    public by eduros93 modified Mar 1, 2019  103  3  2  -1

    4D+ Data Visualization

    plt, pd, sns, faceting, parallel coordinates
    # Parallel coordinates
    # Each data point is a line showing the value of each dim as it goes from
    #   left to right. You can se relation between dimensions, particularly
    #   relations with the "class_column", which is the hue variable
    # Image in comments
    from pandas.plotting import parallel_coordinates
    parallel_coordinates(df, class_column='targetCol', 
                          color=('#FFE888', '#FF9999'))
    # 2D faceting of 2D scatterplots (4D)
    # Image in comments
    g = sns.FacetGrid(data, col="colFacet",  row="rowFacet")
    g =, "xCol", "yCol", edgecolor="w")
    # Line plot
    # Computes the mean of the y variable for each of the x values
    #   You can encode a third dim by using a line for each value of the dim
    #   You add a 4th (and 5th if you want) with facets
    # Image in comments
    grid = sns.FacetGrid(df, row='facetRowVar', size=2.2, aspect=1.6), 'xVar', 'yVar', 'lineVar', palette='deep')

    public by eduros93 modified Mar 1, 2019  55  1  1  0

    3D Data visualization

    plt, pd, sns, faceting, boxplot, pairplot, scatter, scatterplot, density plot
    # Pairplot (image in comments)
    g = sns.pairplot(train[selectedCols], hue='target', palette = 'seismic',
                    size=1.2, diag_kind = 'kde',diag_kws=dict(shade=True),
    # Boxplot faceted for 2nd dim and grouped for 3rd dim (image in comments)
    sns.boxplot(x="facetCol", y="boxplotCol", hue="hueCol", data=df)
    # 1st dim facet, 2nd and 3rd dims are the scatter plot
    #   the hue dimension is used to give statistical info of the y axis var
    #   We discretize the facet variable to have a finite number of facets
    #   We discretize the y axis variable to then show the quartiles in the plot
    #   Image in comments
    df['discreteFacetVar'] = pd.qcut(df['facetVar'], 
                                    q=quantile_list, labels=quantile_labels)
    df['discreteYaxisVar'] = pd.qcut(df['yaxisVar'], 
                                    q=quantile_list, labels=quantile_labels)
    g = sns.FacetGrid(df, col="discreteFacetVar", 
                      hue='discreteYaxisVar'), "xaxisVar", "yaxisVar", alpha=.7)
    # Like scatterplot but showing density. Scatter plot 2.0
    # 3rd dim is hue, we made a manual hue by plotting twice
    #   each time with a different color
    # Image in comments
    plot1 = sns.kdeplot(df1['col1'], df1['col2'],
                      cmap="YlOrBr", shade=True, shade_lowest=False)
    plot2 = sns.kdeplot(df2['col1'], df2['col2'],
                      cmap="Reds", shade=True, shade_lowest=False)

    public by eduros93 modified Mar 1, 2019  48  0  2  0

    2D Data Visualization

    correlation, heatmap, plt, sns, pd, eda
    # 1:
    # Correlation matrix (Pearson correlation)
    def plotCorr(df):
      plt.title('Pearson Correlation of Features', y=1.05, size=15)
                  square=True, linecolor='white', annot=True)			                
    # 2:
    # Focused correlation matrix
    #   Apply some condition on the correlation of the cols over the target col
    #   before plotting it
    corr = df.corr()
    mask = (corr["targetCol"] > 0.4) + (corr["targetCol"] < -0.4)
    selectedCols = corr.loc[mask].index.values
    # 3:
    # Joint plot (image in comments)
    sns.jointplot(x='col1', y='col2', data=df,
                   kind='reg', space=0, size=5, ratio=4)
    # Grouped bar plot
    # Perform discrete histogram on column x and group by coulmn on hue
    sns.countplot(x="histCol", hue="groupCol", data=df)
    # Faceted boxplot
    # As many boxplots of "y" as values has "x"
    sns.boxplot(x="discreteCol", y="continuousCol", data=df)
    # Distplot with 2nd dim as hue (image in comments)
    #   We use FacetGrid to encode the hue beacuse distplot doesn't have it
    #   (last time I checked anyway)
    g = sns.FacetGrid(wines, hue='hueCol'), 'histCol', kde=False, bins=15)

    public by eduros93 modified Mar 1, 2019  33  0  1  0

    Feature engineering with Pandas

    preprocessing, eda, pd
    # Length of str
    train['Name_length'] = train['Name'].apply(len)
    # create binary variable
    train['Has_Cabin'] = train["Cabin"].apply(lambda x: 0 if type(x) == float else 1)
    # create binary var using filters
    dataset['IsAlone'] = 0
        dataset.loc[dataset['FamilySize'] == 1, 'IsAlone'] = 1
    # fill na's with median or other statistic
    dataset['Fare'] = dataset['Fare'].fillna(train['Fare'].median())
    # divide variable into quantiles
    train['CategoricalFare'] = pd.qcut(train['Fare'], 4)
    # divide variable into equal-range bins
    train['CategoricalAge'] = pd.cut(train['Age'], 5)
    # write a function that receives a value from a series and outputs the value of  a
    # new feature
     dataset['Title'] = dataset['Name'].apply(get_title)
    # replace problematic values
    dataset['Title'] = dataset['Title'].replace('Ms', 'Miss')
    # replace in batch with a mapping
    dataset['Sex'] = dataset['Sex'].map( {'female': 0, 'male': 1} ).astype(int)
    # assign a value to a whole filtered selection
    dataset.loc[(dataset['Fare'] > 7.91) & (dataset['Fare'] <= 14.454), 'Fare'] = 1
    # batch replacing in a column
    dataset['Title'] = dataset['Title'].replace(weirdTitlesList, 'Rare')
    # fill nan's with specific guesses for subgroups
    dataset.loc[ (dataset.Age.isnull()) & (dataset.Sex == i) 
                  & (dataset.Pclass == j),'Age'] = myGuess
    • Public Snippets
    • Channels Snippets