Skip to content

Instantly share code, notes, and snippets.

input[type=date] {
-webkit-min-logical-width: 100%;
-webkit-appearance: menulist-button;
}
@theuntitled
theuntitled / compass-config.rb
Last active August 29, 2015 14:03
Generates an inline svg with the specified styles
require File.join(File.dirname(__FILE__), 'inline-svg.rb');
# ... your stuff
@theuntitled
theuntitled / DataContext.cs
Last active December 14, 2018 11:12
Elmah v1.2 POCO and Code First Migration
using System.Data.Entity;
using ProjectName.Models;
namespace ProjectName {
public class DataContext : DbContext {
internal DbSet<ElmahError> ElmahErrors { get; set; }
}
@theuntitled
theuntitled / SomeCopyText.cshtml
Created December 2, 2014 18:29
.NET MVC 5 Themed Partial Extension Method
<p>Text that does not need to be themed</p>
@theuntitled
theuntitled / BootgridExample.cs
Created March 6, 2015 16:13
Bootgrid WebAPI Request / Response Handling
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using System.Web.Http;
using System.Web.Http.Description;
namespace Projektname.BootgridStuff {
/// <summary>
/// Represents a xhr request from a bootgrid component
@theuntitled
theuntitled / MediaHotkeys.cs
Created November 30, 2015 16:10
Send Media Hotkeys with C#
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace MediaHotkeys
{
internal class Program
{
[DllImport("user32.dll", SetLastError = true)]
private static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
@theuntitled
theuntitled / DataContext
Created January 19, 2016 15:34
Nice table names for the IdentityFramework
modelBuilder.Entity<ApplicationUser>().ToTable("Users");
modelBuilder.Entity<IdentityUserRole>().ToTable("UserRoles");
modelBuilder.Entity<IdentityUserLogin>().ToTable("UserLogins");
modelBuilder.Entity<IdentityUserClaim>().ToTable("UserClaims");
modelBuilder.Entity<IdentityRole>().ToTable("Roles");
@theuntitled
theuntitled / magic.sql
Created March 17, 2016 12:01
Select the size and number of rows for each table of the database
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB
FROM
sys.tables t
INNER JOIN
@theuntitled
theuntitled / angular-typescript-inject-demo.ts
Last active March 30, 2016 12:48
TypeScript AngularJS 1.x $inject example
module Dev.Controllers {
export class DemoController {
static $inject: string[] = ["$scope"];
constructor($scope: any) {
// ...
}
@theuntitled
theuntitled / ApplicationUser.cs
Last active October 26, 2023 17:12
Ignoring "Roles", "Claims" and "Logins" when serializing an ApplicationUser / IdentityUser
using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNet.Identity.EntityFramework;
using Newtonsoft.Json;
namespace Project.Models
{
[MetadataType(typeof (ApplicationUserMetaData))]
public class ApplicationUser : IdentityUser
{