This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Elmah : DbMigration | |
{ | |
public override void Up() | |
{ | |
Sql(CreateTable_ELMAH_Error); | |
Sql(CreatreProcedure_ELMAH_GetErrorXml); | |
Sql(CreateProcedure_ELMAH_GetErrorsXml); | |
Sql(CreateProcedure_ELMAH_LogError); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal interface ICacheService | |
{ | |
T Get<T>(string cacheId, Func<T> getItemCallback) where T : class; | |
T Get<T>(string cacheId, CacheDependency cacheDependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, | |
Func<T> getItemCallback) where T : class; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; (function ($, window, document, undefined) { | |
// Create the defaults once | |
var __indexOf = | |
[].indexOf || function(item) { | |
for (var i = 0, l = this.length; i < l; i++) { | |
if (i in this && this[i] === item) return i; | |
} | |
return -1; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests,json,time,httplib, urllib, socket, yaml | |
f = open('ip.yaml') | |
settings = yaml.safe_load(f) | |
f.close() | |
while True: | |
f = open('ipaddress', 'r') | |
current = f.readline() | |
r=requests.get(r'http://jsonip.com') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using System.Linq.Expressions; | |
namespace System.Web.Mvc.Html | |
{ | |
public static class BlockLabelExtensions | |
{ | |
public static IDisposable BeginBlockLabel<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression) | |
{ | |
string expressionText = ExpressionHelper.GetExpressionText(expression); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the semi-colon before function invocation is a safety net against concatenated | |
// scripts and/or other plugins which may not be closed properly. | |
; (function ($, window, document, undefined) { | |
// undefined is used here as the undefined global variable in ECMAScript 3 is | |
// mutable (ie. it can be changed by someone else). undefined isn't really being | |
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined | |
// can no longer be modified. | |
// window and document are passed through as local variable rather than global |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; (function ($, window, document, undefined) { | |
// Create the defaults once | |
var __indexOf = | |
[].indexOf || function (item) { | |
for (var i = 0, l = this.length; i < l; i++) { | |
if (i in this && this[i] === item) return i; | |
} | |
return -1; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof String.prototype.trim !== 'function') { | |
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class FormatWith | |
{ | |
public static string FormatString(string format, object source) | |
{ | |
return FormatString(format, null, source); | |
} | |
public static string FormatString(string format, IFormatProvider provider, object source) | |
{ | |
if (format == null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ResourceFinder | |
{ | |
public static string Get(string resourceName) | |
{ | |
var assembly = Assembly.GetExecutingAssembly(); | |
var result = String.Empty; | |
using (var stream = assembly.GetManifestResourceStream(resourceName)) | |
{ | |
if (stream == null) |
NewerOlder