View SelectLastTopN.sql
Use master | |
go | |
--SQL SERVER SHORTCUT CTRL+5 | |
--Declare @DB as VarChar(200) = db_name(); exec master.dbo.SelectLastTopN 50, @DB, | |
If OBJECT_ID('SelectLastTopN') Is Not Null Drop Procedure SelectLastTopN | |
Go | |
Create Procedure SelectLastTopN |
View Program.cs
using System; | |
using System.Threading; | |
static class Program { | |
static void Main() { | |
Console.Write("Performing some task... "); | |
using (var progress = new ProgressBar()) { | |
for (int i = 0; i <= 100; i++) { | |
progress.Report((double) i / 100); |
View Pluralsight_OrderByAsc_Date.js
// ==UserScript== | |
// @name Order Pluralsight Courses | |
// @version 1.1 | |
// @description Ordena o cursos da pluralsight por data | |
// @match http://*www.pluralsight.com/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// @copyright 2014+, Rods | |
// ==/UserScript== | |
var s_ajaxListener = new Object(); |
View WebProxy.cs
WebService wsrc = new WebService(); | |
wsrc.Proxy = WebRequest.DefaultWebProxy; | |
wsrc.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials; |
View bdisp.xml
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Base class disposable implementation.</Title> | |
<Shortcut>bdisp</Shortcut> | |
<Description> | |
Code snippet to create a scheleton implementation | |
of the IDisposable pattern for a base class. | |
</Description> |
View RenderPartialViewToString.cs
public string RenderPartialViewToString(string viewName, object model) | |
{ | |
if (string.IsNullOrEmpty(viewName)) | |
viewName = ControllerContext.RouteData.GetRequiredString("action"); | |
ViewData.Model = model; | |
using (StringWriter sw = new StringWriter()) | |
{ | |
ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName); |
View GetLastLineFromTextFile.cs
void Main() | |
{ | |
string fileName = @"c:\windows\setupapi.log"; | |
byte[] array = new byte[100]; | |
using (FileStream fs = new FileStream(fileName, FileMode.Open)) | |
{ | |
if (fs.CanSeek && fs.Length > 100) | |
{ | |
fs.Position = fs.Length - 100; |
View DynamicStatus.cs
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Linq; | |
using System.Data; | |
using System.ComponentModel; | |
using System.Dynamic; | |
namespace DynamicStatus | |
{ |
View MailAddressCollection.cs
using System; | |
using System.Net.Mail; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
public class EmailHelper | |
{ | |
MailAddressCollection EmailsTo = new MailAddressCollection(); | |
/// <summary> |
View SVN2.flt
## This is a directory/file filter template for WinMerge | |
name: SVN2 | |
desc: SVN2 | |
## Select if filter is inclusive or exclusive | |
## Inclusive (loose) filter lets through all items not matching rules | |
## Exclusive filter lets through only items that match to rule | |
## include or exclude | |
def: include |