working on it ...

Filters

Explore Public Snippets

Sort by

Found 2,734 snippets matching: quote

    public by Fresh-Dev modified Feb 10, 2016  220832  5  3  0

    Fancy CSS3 Pull-Quotes

    Fancy CSS3 Pull-Quotes: fancyPullQuotes.css
    .has-pullquote:before {
        /* Reset metrics. */
        padding: 0;
        border: none;
         
        /* Content */
        content: attr(data-pullquote);
         
        /* Pull out to the right, modular scale based margins. */
        float: right;
        width: 320px;
        margin: 12px -140px 24px 36px;
         
        /* Baseline correction */
        position: relative;
        top: 5px;
         
        /* Typography (30px line-height equals 25% incremental leading) */
        font-size: 23px;
        line-height: 30px;
    }
     
    .pullquote-adelle:before {
        font-family: "adelle-1", "adelle-2";
        font-weight: 100;
        top: 10px !important;
    }
     
    .pullquote-helvetica:before {
        font-family: "Helvetica Neue", Arial, sans-serif;
        font-weight: bold;
        top: 7px !important;
    }
     
    .pullquote-facit:before {
        font-family: "facitweb-1", "facitweb-2", Helvetica, Arial, sans-serif;
        font-weight: bold;
        top: 7px !important;
    }
    
    

    public by shebin512 modified Jan 6, 2017  1846  2  5  0

    Magento 1.x Update single Quote Item

    Update a single quote Item in magento 1.x
    <?php
    // Update single quote Item/s qty/data.
    
    // Step 1 : Load the quote object. This can be done in variety of ways depending on the location and usage.
    $quoteId=1;
    $itemId = 1234;// Items Id
    $quote = Mage::getModel('sales/quote')->setStore($store)->load($quoteId);
    
    // Step 2 : set the quote object qty manually
    
    // prepare data.
      $params = array();
      $params['qty'] = 5;// similarly you can set any item attribute.
      $request = new Varien_Object($params);
      
    // set Data.
      $quote->updateItem($itemId,$request);
                                        

    public by taganay modified Feb 2, 2017  2109  1  3  0

    quote

    <blockquote><i></i></blockquote>

    public by LongBeard modified Feb 10, 2016  2985  2  4  1

    Fancy CSS3 Pull-Quotes

    Fancy CSS3 Pull-Quotes: fancyPullQuotes.css
    .has-pullquote:before {
        /* Reset metrics. */
        padding: 0;
        border: none;
         
        /* Content */
        content: attr(data-pullquote);
         
        /* Pull out to the right, modular scale based margins. */
        float: right;
        width: 320px;
        margin: 12px -140px 24px 36px;
         
        /* Baseline correction */
        position: relative;
        top: 5px;
         
        /* Typography (30px line-height equals 25% incremental leading) */
        font-size: 23px;
        line-height: 30px;
    }
     
    .pullquote-adelle:before {
        font-family: "adelle-1", "adelle-2";
        font-weight: 100;
        top: 10px !important;
    }
     
    .pullquote-helvetica:before {
        font-family: "Helvetica Neue", Arial, sans-serif;
        font-weight: bold;
        top: 7px !important;
    }
     
    .pullquote-facit:before {
        font-family: "facitweb-1", "facitweb-2", Helvetica, Arial, sans-serif;
        font-weight: bold;
        top: 7px !important;
    }
    
    

    public by lbottaro modified Mar 18, 2013  4886  7  6  1

    smbclient to remotely copy from linux to windows env

    This script allows to keep synchronized a windows based client with a linux machine. Details for smbclient command: -U: set the credentials to login -c: execute a command (between quotes) The command executed includes: -lcd: set the specified directory to local machine -mput: copy one or more local files to the remote computer
    #!/bin/bash
    
    # Linux source directory to copy from: /home/tmp/
    # Windows target directory where to copy: \\1.2.3.4\SharedDirectory\filesDir
    
    user=myUser
    pwd=myPwd
    targetIP=1.2.3.4
    sharedDirRoot=SharedDirectory
    targetDir=filesDir
    linuxSourceDir=/home/tmp/
    
    echo '- Updating Client folder -'
    smbclient -U $user%$pwd //$targetIP/$sharedDirRoot -c "cd $targetDir; lcd $linuxSourceDir; prompt off;recurse; mput *;"
    echo '- Remote Client Updated -'

    public by lbottaro modified Mar 26, 2015  1580  15  6  2

    Execute a linux command at regular intervals

    Use Linux watch to execute a running command at certain time. Note the usage of double quotes to include a complex command, eg ls -la AND grep result Options: -n 5: exec every 5s
    watch -n 5 "ls -la | grep something"                                           

    public by zonaro modified Nov 6, 2015  2225  3  7  2

    Transact SQL IsNull Port for C#

    Like IsNull of Transact SQL, just try object.isnull(), It returns the text in 'quotes' or the NULL value. Configurable with optional parameters
    public static class SQLPort
       {
           public static string isNull(this object Text, string NullValue = "NULL", bool Quotes = true)
           {
               return string.IsNullOrWhiteSpace(""+Text) ? NullValue : (Quotes ? "'" + (""+Text).Replace("'","''") + "'" : ""+ Text);
           }
           
       }
                                                                                                    

    public by msdn modified Jan 12, 2015  76929  0  6  0

    ParseArgs2: Parses a command-line-style argument string.

    Parses a command-line-style argument string. Similar to Utilities.ParseArgs, but takes just a single string, which can contain multiple arguments. For instance, you could pass the output of GetCommandLine to ParseArgs2. The advantage of using GetCommandline and ParseArgs2 over ParseArgs is that dealing with quotes and esc
    using System;
    using System.ComponentModel;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.Collections.Specialized;
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using System.Text;
    using System.Globalization;
    
    // This arg-parsing regex is pretty hairy... we have some test cases for it under
    // the test directory to prevent regressions in case it ever needs to be modified.
    private static readonly Regex sm_argsRegex2 = new Regex(
                    @"(/|-)(?<arg>(\w+)|\?|!)" + // argument name
                    @"(" +                 // The optional argument value
                        @"(:|=)[ \t]*" +   // TODO: should I allow space after?
                        @"(?<argval>" +
                            @"(" +         // The quoted case
                                @"""" +    // start quote
                                    @"([^""\\]*(\\""?)?)*" +
                                @"""" +    // end quote
                            @")|(" +       // The non-quoted case
                                @"[^/""-]\S*" +
                            @")" +
                        @")" +
                    @")?" );
    
    /// <summary>
    ///    Parses a command-line-style argument string.
    /// </summary>
    /// <remarks>
    /// <para>
    ///    Similar to Utilities.ParseArgs, but takes just a single string, which can
    ///    contain multiple arguments. For instance, you could pass the output of
    ///    GetCommandLine to ParseArgs2. The advantage of using GetCommandline and
    ///    ParseArgs2 over ParseArgs is that dealing with quotes and escaped quotes
    ///    with the normal tokenized C# main string[] arguments is problematic.
    /// </para>
    /// <para>
    ///    Arguments can look like this:
    ///    <pre>
    ///    -foo:bar /foo: bar /foo="bar baz" -foo= "bar baz"
    ///    </pre>
    /// </para>
    /// </remarks>
    /// <param name="args">
    ///    The command line arguments to parse.
    /// </param>
    public static Dictionary< string, string > ParseArgs2( string args )
    {
        Dictionary< string, string > argDict = new Dictionary< string, string >();
        foreach( Match match in sm_argsRegex2.Matches( args ) )
        {
            string arg = match.Groups[ "arg" ].Value;
            string argval = match.Groups[ "argval" ].Value;
    
            // How to handle \" escape sequences:
            //       1. Pop off outer "s
            //       2. Condense any \" to "
            if( argval.StartsWith( "\"" ) && argval.EndsWith( "\"" ) )
            {
                argval = argval.Substring( 1, argval.Length - 2 );
                argval = argval.Replace( "\\\"", "\"" );
            }
    
            argDict.Add( arg, argval );
        }
        return argDict;
    } // end ParseArgs2()

    public by msdn modified Jan 12, 2015  468  0  5  0

    GetETag: Gets an ETag from a response.

    Gets an ETag from a response. The web response. A quoted ETag string.
    /// <summary>
    /// Gets an ETag from a response.
    /// </summary>
    /// <param name="response">The web response.</param>
    /// <returns>A quoted ETag string.</returns>
    internal static string GetETag(HttpWebResponse response)
    {
        return response.Headers[HttpResponseHeader.ETag];
    }

    external by The-Duchess modified Dec 6, 2015  45  0  1  0

    given a text file ./QUOTES.txt formatted by line with {CHARACTER NAME} preceeding quotes by that character quotes.rb will display a random quote by that character

    given a text file ./QUOTES.txt formatted by line with {CHARACTER NAME} preceeding quotes by that character quotes.rb will display a random quote by that character: quotes.rb
    #-------~-----~--~------~---~-------~----~------------~---~------------~-----~--~------~---~-------~----~------------~---~-----
    # quotes.rb
    # Author: Alice "Duchess" Archer
    # usage: [ruby] ./quotes.rb [<character name>]
    # example: ruby ./quotes.rb Leonard Church
    #-------~-----~--~------~---~-------~----~------------~---~------------~-----~--~------~---~-------~----~------------~---~-----
    
    def file
          @file = File.readlines("./QUOTES.txt")
    end
    
    def get_quotes character
          lines = file
          lines.each { |a| a.chomp! }
          quote_lines = []
          at_character = false
          lines.each do |line|
                if line =~ /\{.+\}/
                      if line =~ /\{#{character}\}/ and !at_character
                            at_character = true
                            next
                      elsif line =~ /\{.+\}/ and at_character
                            break;
                      end
                end
    
                if at_character
                      quote_lines.push(line)
                end
    
          end
    
          return quote_lines
    end
    
    def pick_quote quote_lines
          length = quote_lines.length
          i = rand(length)
          return quote_lines[i]
    end
    
    character = ""
    
    0.upto(ARGV.length - 1) { |i| character.concat("#{ARGV[i]} ") }
    character = character[0..-2].to_s
    
    puts "#{pick_quote(get_quotes(character))} - #{character}"
    
    
    
    • Public Snippets
    • Channels Snippets