Skip to content

Instantly share code, notes, and snippets.

View MarioBinder's full-sized avatar
:octocat:
.

Mario Binder MarioBinder

:octocat:
.
View GitHub Profile
@MarioBinder
MarioBinder / Extendend Version
Created September 18, 2012 04:05
Bindable Run
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);
}
@MarioBinder
MarioBinder / Example
Created September 26, 2012 16:35
SQL Procedure -EF Code First
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));
@MarioBinder
MarioBinder / SessionExpireFilterAttribute
Created November 4, 2014 06:19
SessionExpireFilterAttribute
[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();
@MarioBinder
MarioBinder / sqlscripts
Last active September 13, 2019 10:26
select a daterange #sql #date
declare @selecteddate date = cast(getdate() as date);
SELECT *
FROM foo
WHERE Date >= DATEADD(day, 0, convert(date, @selecteddate)) and Date < DATEADD(day, 1, convert(date, @selecteddate))
Examples
declare @selecteddate date = cast(getdate() as date); --today
declare @selecteddate date = cast(getdate() -1 as date); --yesterday
@MarioBinder
MarioBinder / bug tracking applications
Created November 4, 2014 08:10
bug tracking applications
## 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)
@MarioBinder
MarioBinder / font combinations
Created November 4, 2014 08:19
font combinations
## 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/)
@MarioBinder
MarioBinder / web conferencing tools
Last active May 14, 2018 06:06
web conferencing tools
## web conferencing tools
+ [vyew](http://vyew.com/s/)
+ [onwebinar](http://www.onwebinar.com/)
+ [meetingburner](https://www.meetingburner.com/)
+ [big blue button](http://bigbluebutton.org/overview/)
+ [managemeet](https://www.managemeet.com/)
+ [sync](http://sync.in/)
+ [show document](http://www.showdocument.com/)
+ [webhuddle](https://www.webhuddle.com/)
+ [anymeeting](http://www.anymeeting.com/)
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
@MarioBinder
MarioBinder / validate.password.js
Last active September 13, 2019 10:20
Validate Passwort with Javascript
function checkPassword(pass) {
var numbers = pass.match(/\d+/g);
var uppers = pass.match(/[A-Z]/);
var lowers = pass.match(/[a-z]/);
var special = pass.match(/[!@#$%\^&*\+]/);
if (numbers === null || uppers === null || lowers === null || special === null)
valid = false;
@MarioBinder
MarioBinder / WaitAndRetry.cs
Last active August 15, 2017 05:47
wait and retry method pattern
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)
{