This file contains 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
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
public class SessionExpireFilterAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
var ctx = HttpContext.Current; | |
if (ctx.Session["RegisteredUser"] == null || !filterContext.HttpContext.Request.IsAuthenticated) | |
{ | |
FormsAuthentication.SignOut(); | |
ctx.Session.Clear(); |
This file contains 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
## bug tracking applications for developers | |
+ [BugLog](http://www.bugloghq.com/) (opensource) | |
+ [BugNET Issue Tracker](http://www.bugnetproject.com/) (commercial, opensource) | |
+ [Trac](http://trac.edgewall.org/) | |
+ [Bugzilla](http://www.bugzilla.org/) (opensource) | |
+ [Snowy Evening](https://snowy-evening.com/) | |
+ [MantisBT](http://www.mantisbt.org/) (commercial, free plan) | |
+ [Bugify](https://bugify.com/) (commercial) | |
+ [Lighthouse](http://lighthouseapp.com/) (commercial) | |
+ [TheBuggenie](http://www.thebuggenie.com/) (commercial) |
This file contains 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 Crud | |
{ | |
public static int Save<T>(this T entity, ZeiterfassungsContext ctx) where T : class, ICrud | |
{ | |
if (entity == null) | |
throw new ArgumentNullException("entity", "Die Entität darf nicht null sein"); | |
return Exists(entity, "Id", ctx) ? Update(entity, ctx) : Insert(entity, ctx); | |
} | |
public static int Insert<T>(this T entity, ZeiterfassungsContext ctx) where T : class, ICrud |
This file contains 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 BindableExtender { | |
public static string GetBindableText(DependencyObject obj) { | |
return (string)obj.GetValue(BindableTextProperty); | |
} | |
public static void SetBindableText(DependencyObject obj, | |
string value) { | |
obj.SetValue(BindableTextProperty, value); | |
} |
This file contains 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
db.Database.SqlCommand("dbo.News_Insert @Title, @Body, @NewsStatusId", | |
new SqlParameter("Title", news.Title), | |
new SqlParameter("Body", news.Body), | |
new SqlParameter("NewsStatusId", news.NewStatus.Id)); |
This file contains 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
## Font Combinations | |
+ [Beatiful Web Type Combinations](http://bueltge.de/free-web-font-combinations/) | |
+ [Typ.io](http://www.typ.io/) | |
+ [Google Web Fonts Typographic Project](http://femmebot.github.io/google-type/) | |
+ [Discover.typograhy](http://discover.typography.com/) | |
+ [I Font You](http://ifontyou.com/) | |
+ [Type Connection](http://www.typeconnection.com/) | |
+ [Beatiful Web Type](http://hellohappy.org/beautiful-web-type/) | |
+ [Typewolf](http://www.typewolf.com/) | |
+ [Just my type](http://justmytype.co/) |
This file contains 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 WaitAndRetry | |
{ | |
public static void Do(Action action, TimeSpan waitInterval, int retryCount = 3) | |
{ | |
Do<object>(() => { action(); return null; }, | |
waitInterval, retryCount); | |
} | |
public static T Do<T>(Func<T> action, TimeSpan waitInterval, int retryCount = 3) | |
{ |
This file contains 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
//https://stackoverflow.com/a/17488875/119109 | |
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name]) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} |
This file contains 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 ActionResult Export(ViewModel model) | |
{ | |
var fileData = _repo.GetFile(model...); | |
var serializer = new JavaScriptSerializer { MaxJsonLength = Int32.MaxValue, RecursionLimit = 100 }; | |
var dataJson = new DownloadAjaxResult(true) | |
{ | |
File = fileData, | |
Filename = model.Filename | |
}; | |
return new ContentResult() |
This file contains 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
UPDATE s | |
SET s.IsFreezed = 1 | |
FROM [DBNAME].[dbo].[COLUMN] AS s | |
INNER JOIN [DBNAME].[dbo].[COLUMN] AS m | |
ON s.Id = m.StatusId | |
WHERE m.Subject = 'xxxxx' | |
AND s.HasSent = 0; |
OlderNewer