working on it ...

Filters

Explore Public Snippets

Sort by

Found 1.7M snippets

    public by AlexS modified Friday at 8:25:19 AM  17  1  2  0

    esp

    public OperationResult UploadRelease(Release release, byte[] resourceBytes, string cookieid)
    {
        ESPUploadSites uploadsite = ESPUploadSites.USWest;
        ESPBatch batch = lastbatch;
        OperationError error = null;
        OperationResult opresult = null;
        int partno = 1;
        string csrftoken = "";
        string fname = GetESPReleaseFileName(release.Name);
        string time = Tools.GetJavaScriptTime(DateTime.Now).ToString();
        string date = "";
        string auth = "";
        string uploadid = "";
        string data = "";
        string rid = "";
        TimeSpan zero1 = TimeSpan.Zero;
        List<string> etags = new List<string>();
        HTTPRequest r = GetMainPageRequest(cookieid);
        opresult = AuthenticatedRequest(r, Authorize, CheckAuthNotLost, null);
        if (!opresult.Success)
            return opresult;
        if (!ParseMainPage(r, ref csrftoken, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadInitRequest(batch.ID, time, fname, uploadsite, cookieid);
        HTTPRequestResult result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!ParseReleaseUploadInitResponse(r, ref date, ref auth, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadStartOptionsRequest(batch.ID, time, fname, uploadsite, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!CheckReleaseUploadStartOptionsResponse(r, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadStartRequest(batch.ID, time, fname, uploadsite, date, auth, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!ParseReleaseUploadStartRequest(r, ref uploadid, ref error))
            return new OperationResult(error);
    
        long length = resourceBytes.Length;
        string chunkhash = Tools.GetSHA256(resourceBytes);
        TimeSpan zero2 = TimeSpan.Zero;
        r = GetReleaseUploadChunkInitRequest(batch.ID, time, fname, chunkhash, partno, uploadid, uploadsite, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!ParseReleaseUploadChunkInitResponse(r, ref date, ref auth, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadChunkOptionsRequest(batch.ID, time, fname, uploadid, partno, uploadsite, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!CheckReleaseUploadChunkOptionsResponse(r, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadChunkRequest(batch.ID, time, fname, uploadid, partno, uploadsite, resourceBytes, chunkhash, date, auth, cookieid);
        //Is long
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!CheckReleaseUploadChunkResponse(r, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadChunksListInitRequest(batch.ID, time, fname, uploadid, uploadsite, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!ParseReleaseUploadChunksListInitResponse(r, ref date, ref auth, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadChunksListOptionsRequest(batch.ID, time, fname, uploadid, uploadsite, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!CheckUploadChunkOptionsResponse(r, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadChunksListRequest(batch.ID, time, fname, uploadid, uploadsite, date, auth, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!ParseReleaseUploadChunksListResponse(r, etags, ref error))
            return new OperationResult(error);
        data = GetUploadCompleteData(etags.ToArray());
        chunkhash = Tools.GetSHA256(Encoding.ASCII.GetBytes(data));
        r = GetReleaseUploadCompleteInitRequest(batch.ID, time, fname, uploadid, uploadsite, chunkhash, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!ParseReleaseUploadCompleteInitResponse(r, ref date, ref auth, ref error))
            return new OperationResult(error);
        r = GetReleaseUploadCompleteRequest(batch.ID, time, fname, uploadid, uploadsite, date, auth, data, chunkhash, cookieid);
        result = HTTP.ExecSync(r);
        if (result != HTTPRequestResult.Success)
            return new OperationResult(result, r, StockId);
        if (!CheckReleaseUploadCompleteResponse(r, batch.ID, time, fname, ref error))
            return new OperationResult(error);
        r = GetReleaseCreateRequest(batch, release, time, fname, csrftoken, cookieid);
        result = HTTP.ExecSync(r);
        return result == HTTPRequestResult.Success ? (ParseReleaseCreateResponse(r, release, ref rid, ref error) ? new OperationResult(false) : new OperationResult(error)) : new OperationResult(result, r, StockId);
    }
    
    

    public by paulsimmons modified Apr 12, 2017  22  0  2  0

    WooCommerce Bookings and Appointment Plugin

    WooCommerce Bookings and Appointment plugin by FMEAddons gives the ability to business owners to sell products and services that require bookings and timed appointments. These products and services involve tickets selling, bookings for concerts, appointments, rentals services, secure a seat online, space in training, book products and much more lik
    // Enter here the actual content of the snippet.            

    public by paulsimmons modified Apr 11, 2017  28  0  2  0

    Rich Snippets Magento Extension by FMEAddons

    Magento rich snippets extension for online stores helps the store owners to highlight their products in search results and drag more traffic on the website. This is a must have plugin if you want the success of your business through organic traffic from search engines. This rich snippet module adds schema tags in all product and services pages to
    // Enter here the actual content of the snippet.            

    public by SpeedOfSpin modified Apr 7, 2017  39  0  1  0

    Mime Types

    nix
    <staticContent>
        <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
        <mimeMap fileExtension=".m4v" mimeType="video/m4v" />
        <mimeMap fileExtension=".ogg" mimeType="video/ogg" />
        <mimeMap fileExtension=".ogv" mimeType="video/ogg" />
        <mimeMap fileExtension=".webm" mimeType="video/webm" />
    
        <mimeMap fileExtension=".oga" mimeType="audio/ogg" />
        <mimeMap fileExtension=".spx" mimeType="audio/ogg" />
    
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
    
        <remove fileExtension=".eot" />
        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        <mimeMap fileExtension=".otf" mimeType="font/otf" />
        <mimeMap fileExtension=".woff" mimeType="font/x-woff" />
    </staticContent>         

    public by randy14nov modified Apr 6, 2017  50  1  4  0

    Hotmail Customer Service Number

    You can dial our Hotmail client benefit number for any tech issue in your hotmail account. Our experts give you best and fast answer for a specific issue. To find best solutions for your each specialized issue concerning us you can dial our toll free hotmail customer care number @ +1-844-331-5444. http://www.hotmail-supportnumber.com/
    http://www.emailhelpnumber.com/hotmail-help-number.html

    public by andrew14nov modified Apr 6, 2017  37  2  3  0

    Yahoo customer Care service support

    We are tech support expert provide customer support to US issues related to webmail services. Because sometimes this problem occurs in yahoo but there is nothing to worry about it, because our yahoo customer care service providers are always available for you. We have more than 50 experts and technicians for solving customer problems. We are third
    http://www.emailhelpnumber.com/yahoo-help-number.html
    

    public by harrygg modified Apr 5, 2017  52  2  2  0

    XBMC Kodi snippets

    d
    ### get Kodi version
    import xbmc
    version = int(xbmc.getInfoLabel("System.BuildVersion" )[0:2])
    
    ### Execute builtin
    xbmc.executebuiltin('XBMC.StopPVRManager')
    ALARMCLOCK = "AlarmClock(%s, RunScript(%s, False), %s, silent)"
    command = ALARMCLOCK % ("SCHEDULED RUN", addon_id, 3600)
    xbmc.executebuiltin(command)
    
    ### Execute JSON RPC
    command = '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"pvr.iptvsimple","enabled":%s},"id":1}'
    xbmc.executeJSONRPC(command % "false")
    
    ### Error levels
    xbmc.LOGDEBUG = 0
    xbmc.LOGINFO = 1
    xbmc.LOGNOTICE = 2
    xbmc.LOGWARNING = 3
    xbmc.LOGERROR = 4
    xbmc.LOGSEVERE = 5
    xbmc.LOGFATAL = 6
    xbmc.LOGNONE = 7
    
    

    public by SpeedOfSpin modified Apr 4, 2017  45  0  2  0

    Retry

    c#
    public class Retry
        {
            /// <summary>
            /// Generic Retry
            /// </summary>
            /// <typeparam name="TResult">return type</typeparam>
            /// <param name="action">Method needs to be executed</param>
            /// <param name="retryInterval">Retry interval</param>
            /// <param name="retryCount">Retry Count</param>
            /// <param name="expectedResult">Expected Result</param>
            /// <param name="isExpectedResultEqual">true/false to check equal 
            /// or not equal return value</param>
            /// <param name="isSuppressException">
            /// Suppress exception is true / false</param>
            /// <returns></returns>
            public static TResult Execute<TResult>(
              Func<TResult> action,
              TimeSpan retryInterval,
              int retryCount,
              TResult expectedResult,
              bool isExpectedResultEqual = true,
              bool isSuppressException = true
               )
              {
                TResult result = default(TResult);
    
                bool succeeded = false;
                var exceptions = new List<Exception>();
    
                for (int retry = 0; retry < retryCount; retry++)
                {
                    try
                    {
                        if (retry > 0)
                            Thread.Sleep(retryInterval);
                        // Execute method
                        result = action();
    
                        if (isExpectedResultEqual)
                            succeeded = result.Equals(expectedResult);
                        else
                            succeeded = !result.Equals(expectedResult);
                    }
                    catch (Exception ex)
                    {
                        exceptions.Add(ex);
                    }
    
                    if (succeeded)
                        return result;
                }
    
                if (!isSuppressException)
                    throw new AggregateException(exceptions);
                else
                    return result;
            }
        }      

    public by mariya15 modified Apr 4, 2017  61  2  4  0

    McaFee Antivirus Customer Service Number

    Get customer support service for mcafee antivirus issues like mcafee not scanning viruses, how to update mcafee antivirus software, mcafee antivirus not working. You can contact to our Mcafee antivirus technical support experts for all these types of problems and we have our customer care telephone number : 1-888-411-1123 (Toll-free Number) USA. Co
    Call Mcafee Antivirus Customer Care Number: 1-888-411-1123

    public by paulsimmons modified Apr 4, 2017  50  0  3  0

    WooCommerce Variable Pricing Plugin by FMEAddons

    If you want to convert potential customers to successful business leads, then WooCommerce variable pricing extension is a powerful tool for achieving this goal. This addon provides you an easy interface to offer bulk discounts on various sections on your website. You can give a special offer to your customers such as buy three products and get one
    // Enter here the actual content of the snippet.            
    • Public Snippets
    • Channels Snippets