working on it ...

Filters

Explore Public Snippets

Sort by

Found 741 snippets matching: %placeholder

    public by JKCPR  3051  5  5  1

    SCSS button power @mixin

    one $color variable generates all buttons by @mixin and color @functions also leverages %placeholders and %placeholder-selectors
    //core values
    $font-size:16;
    $primary: #0085B7;
    $success: adjust_hue($primary, 260);
    $warning: saturate(adjust_hue($primary, 188), 43);
    $alert: lighten(saturate(adjust_hue($primary, 162), 12), 1);
    
    // function
    @function em($target, $context:$font-size){
      @return ($target/$context) * 1em;
    }
    
    //!default values
    $button-colour: $primary !default;
    $button-text-color: white !default;
    $button-line-height: 32 !default;
    $button-border-radius: 3 !default;
    $button-padding: 30 !default;
    $button-font-size: 24 !default;
    $button-weight: bold !default;
    
    //the btn mixin
    @mixin default-button($color: $button-text-color,
      $line-height: $button-line-height,
      $radius: $button-border-radius,
      $padding: $button-padding,
      $font-size: $button-font-size,
      $weight: $button-weight){
      
      color: $color;
      line-height: em($line-height);
      border-radius: em($radius);
      padding: 0 em($padding);
      font-size: em($font-size);
      font-weight: $weight;
    }
    
    @mixin flat-button($color: $button-color){
      $highlight-color: lighten($color, 50%);
      $shadow-color: grayscale(transparentize($color, 0.1));
    
      background-color: $color;
      border: 1px solid darken($color, 10%);
      text-shadow: 0px 1px 1px darken($color, 20%);
      box-shadow: 0 em(2) em(6) 0 $shadow-color;
      &:hover{
        background-color: darken($color, 5%);
        text-shadow: 1px 1px 1px darken($highlight-color, 5%);
      }
    }
    
    //placeholder selector
    %default-button{
      @include default-button;
    }
    .primary{
      @extend %default-button;
      @include flat-button($primary);  
    }
    .success{
      @extend %default-button;
      @include flat-button($success);
    }
    .warning{
      @extend %default-button;
      @include flat-button($warning);
    }
    .alert{
      @extend %default-button;
      @include flat-button($alert);
    }

    public by zonaro  2419  1  6  0

    Placeholder for DIVs

    Create a placeholder for divs with ContentEditable, just put the placeholder text into data-placeholder attribute
    [contentEditable=true]:empty:not(:focus):before {
               color: #ACACAC;
               content: attr(data-placeholder);
           }

    public by restlessankur  2789  1  5  0

    placeholder simple

    //enter here the actual content of the snippet:
    //the stuff you want to copy-and-paste wherever you need.
    
    console.writeline("its awesome {0}", username)
    

    public by congruityservice  2169  1  5  0

    Move Control Over Placeholder Control

    The snippet moves one control over another control. Useful if you need to design a form with place holders and then move the actual field onto that placeholder.
    *Move TXT_FNAME edit line over the LBL_PLACEHOLDER1 label.
    pcopTarget = @WINDOW:".LBL_PLACEHOLDER1"
    pcopSource = @WINDOW:".TXT_FNAME"
    Gosub PlaceControlOverPlaceholder
    
    *
    * Sub moves control over the specified placeholder control
    *
    PlaceControlOverPlaceholder:
    	*Acronym
    	*pcop - Place Control Over Placeholder
    
    	If Unassigned(pcopOffset_X) Then pcopOffset_X = 0
    	If Unassigned(pcopOffset_Y) Then pcopOffset_Y = 0
    
    	pcopS = Get_Property(pcopSource,'SIZE')
    	pcopT = Get_Property(pcopTarget,'SIZE')
    
    	pcopS<1> = pcopT<1> + pcopOffset_X ;* X
    	pcopS<2> = pcopT<2> + pcopOffset_Y	;* Y
    	*S<3> = 100 ;* Width
    	*S<4> = 20	;* Height
    
    	Call Set_Property(pcopSource,'SIZE', pcopS)
    
    	Call Set_Property(pcopSource,"VISIBLE", 0)
    	Call Set_Property(pcopTarget,"VISIBLE", 1)
    
    	pcopOffset_X = 0
    	pcopOffset_Y = 0
    
    Return
    *
    * End PlaceControlOverPlaceholder
    *
                

    public by cghersi  3291  2  8  0

    C#: How to dinamically check a string and its length using a Regex

    Thsi method creates a Regex by replacing a placeholder as minimum and maximum length (e.g. in case of username and / or password verifiers...). It can be extended also to apply different Regex with respect to some particular business logic.
    static private string s_nameRegEx = @"^[_a-zA-Z][_a-zA-Z0-9-. ]{ç,§}$"; //'ç' is a placeholder for actual minimum length, '§' is a placeholder for actual maximum length
            
    public static bool NameIsValid(string candidateName, int minimumLen, bool checkOnlyLen, int maxLen = int.MaxValue)
    {
        if (candidateName == null)
            return (minimumLen == 0); //return false if there's a minimum len
        string trimmedName = candidateName.Trim();
        if ((trimmedName.Length < minimumLen) || (trimmedName.Length > maxLen))
            return false;
        if (checkOnlyLen)
            return true;
        Regex nameExpr = new Regex(s_nameRegEx.Replace("ç", (minimumLen - 1) + "").Replace("§", (maxLen - 1) + ""));
        return nameExpr.IsMatch(trimmedName);
    }
    

    public by mirage3d  4222  0  6  0

    Custom SpriteKit Scene in Swift - Xcode

    A bare-bones custom SpriteKit scene snippet in Swift for Xcode with placeholder tokens
    // XCode bare-bones custom SpriteKit scene snippet
    
    import SpriteKit
    
    class <#Custom#>Scene: SKScene {
    	// MARK: - Properties
    	// use optionals or initialised values to avoid having to write
    	// custom init()'s and the required required init?(coder aDecoder: NSCoder)
    	var <#property1#>: Int!
    	var <#property2#>: CGPoint!
    	let <#property3#> = 3.1415962
    	var <#button1#>: SKSpriteNode!
    	var <#sprite#1>: SKSpriteNode!
    	var <#helperNode#>: SKSNode!
    
    	// MARK: - Methods
    	override func didMoveToView(view: SKView) {
    		<#code#>	
    	}
    
    	override func willMoveFromView(view: SKView) {
    		<#code#>	
    	}
    
    	override func update(currentTime: NSTimeInterval) {
    		<#code#>	
    	}
    
    	// MARK: - <#Other Methods#>
    }
                

    public by paulsimmons  300  21  3  1

    WooCommerce Checkout Plugin by FMEAddons

    You can crate extra options on checkout form by using WooCommerce checkout plugin by FMEAddons. This addon lets you add the various fields which are text area, radio and check boxes, file/image select, multi-select, date & time, password, input and select box personalize the checkout form. With this addon, you can get extra information on checkout
    cpp
    <a href="https://www.fmeaddons.com/woocommerce-plugins-extensions/additional-checkout-fields.html">https://www.fmeaddons.com/woocommerce-plugins-extensions/additional-checkout-fields.html<a>                        

    public by UdeF  1472  2  5  0

    Hide everything except some elements on webpage

    Replace placeholder %{item to hide}% with the item.
    function addGlobalStyle(css) {
        var head, style;
        head = document.getElementsByTagName('head')[0];
        if (!head) { return; }
        style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = css;
        head.appendChild(style);
    };
     
    //Avoid conflicts
    this.$ = this.jQuery = jQuery.noConflict(true);
    $(document).ready(function()
    {
    /*
        alert("jQuery is loaded");
        $('body > :not(%{item to hide}%) OR :not').hide(); //hide all nodes directly under the body
        $('%{item to hide}%').appendTo('body');
        $( "%{item to hide}%" ).append( "</br>" );
    */  
        $("body > *").hide(); 
        $("%{item to hide}%").show();
        $("%{item to hide}%").appendTo('body');
        $("%{item to hide}%").append( "</br>" );
        // addGlobalStyle('%{item to hide}% { margin: 10px !important; }');
        addGlobalStyle('body { line-height: 1.8 !important; margin: 10px !important; }');
    });           

    public by msdn  1071  0  7  0

    WriteXmlFile: Writes the XML file.

    Writes the XML file. The type of the object to serialize. The that is a placeholder of the file. The item unique identifier. The object to serialize.
    using System;
    using System.IO;
    using System.Xml;
    using System.Xml.Serialization;
    using Microsoft.SharePoint;
    
    /// <summary>
    /// Writes the XML file.
    /// </summary>
    /// <typeparam name="type">The type of the object to serialize.</typeparam>
    /// <param name="library">The <see cref="SPDocumentLibrary"/> that is a placeholder of the file.</param>
    /// <param name="itemId">The item unique identifier.</param>
    /// <param name="content">The object to serialize.</param>
    public static void WriteXmlFile<type>(SPDocumentLibrary library, int itemId, type content)
      where type : IStylesheetNameProvider
    {
      SPFile _file = library.GetItemByIdSelectedFields(itemId).File;
      File.WriteXmlFile<type>(_file, content, content.StylesheetNmane);
    }

    external by cdmedia  595517  17  5  -2

    Placeholder for UITextView in Xamarin

    Placeholder for UITextView in Xamarin: gistfile1.cs
    // sample text box
    var descriptionField = new UITextView (new RectangleF (0, 230, UIScreen.MainScreen.Bounds.Width, 100)){
    	BackgroundColor = UIColor.White,
    	Text = " Description:",
    	TextColor = ViewHelpers.DarkGray,
    	Font = UIFont.FromName("Helvetica", 18f)
    };
    // some work arounds for UITextView placeholders
    var Placeholder = " Description:";
    descriptionField.ShouldBeginEditing = t => {
    	if (descriptionField.Text == Placeholder) {
    		descriptionField.Text = string.Empty;
      }	
    	return true;
    };
    descriptionField.ShouldEndEditing = t => {
    	if (string.IsNullOrEmpty (descriptionField.Text)) {
    		descriptionField.Text = Placeholder;
    	}
    	return true;
    };
    
    
    • Public Snippets
    • Channels Snippets