Skip to content

Instantly share code, notes, and snippets.

View mahizsas's full-sized avatar

MAHIZ mahizsas

View GitHub Profile
@constellates
constellates / timeago.filter.js
Last active August 29, 2015 14:03 — forked from rodyhaddad/timeago.filter.js
A time ago filter with built in timezone conversion from a UTC time source.
.filter('timeago', function () {
/*
* time: the time
* local: compared to what time? default: now
* raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
*/
// parse string date to milliseconds
// Note: months are 0-based
@mahizsas
mahizsas / web.config
Last active August 29, 2015 14:08 — forked from wullemsb/web.config
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=Edge" />
</customHeaders>
</httpProtocol>
<system.webServer>
@mahizsas
mahizsas / DatabaseServerStatusController.cs
Last active August 29, 2015 14:08 — forked from darrelmiller/gist:972f01aa64c6e5df37df
DatabaseServerStatusController
using System;
using System.Data;
using System.Data.SqlClient;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using Newtonsoft.Json.Linq;
Dropping Database.
Rebuild Database with latest Schema.
Load basic test environment data.
Loading basic account data.
Opening outer Transaction scope
Executing test 1.
Executing test 2.
Roll back transaction scope.
@mahizsas
mahizsas / Demo-Entity-Framework.cs
Last active August 29, 2015 14:12 — forked from hudo/Program.cs
Create Standalone Entity-Framework Model-Test
class Program
{
static void Main(string[] args)
{
Database.SetInitializer(new DropCreateDatabaseAlways<PeopleContext>());
var context = new PeopleContext();
context.Database.Log = Console.WriteLine; // so we can inspect SQL statements
AddOnePerson(context);