Skip to content

Instantly share code, notes, and snippets.

EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats <pre> tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663

Here's the canonical TOML example from the TOML README, and a YAML version of the same.

title = "TOML Example"
 
@igordeoliveirasa
igordeoliveirasa / gist:78a310f0348fcad9b270
Created March 26, 2015 01:41
iOS Loading Overlay View - SWIFT
//
// LoadingOverlay.swift
// app
//
// Created by Igor de Oliveira Sa on 25/03/15.
// Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved.
//
// Usage:
//
// # Show Overlay
@paulduran
paulduran / gist:91dd14c0eecc6b1ff22f
Created November 27, 2014 00:57
Premailer with Postal
public class MailSender
{
static MailSender()
{
var viewRenderer = new EmailViewRenderer(ViewEngines.Engines) {EmailViewDirectoryName = "UserMailer"};
var emailParser = new EmailParser(viewRenderer);
Email.CreateEmailService = ()=>new EmailService(viewRenderer, new PremailerEmailParser(emailParser), ()=>new SmtpClient());
}
public void SendEmail()
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@mbejda
mbejda / knockoutUtility.js
Created October 25, 2014 06:54
List of Knockout Utility Functions
ko.utils.arrayForEach
ko.utils.arrayFirst
ko.utils.arrayFilter
ko.utils.arrayGetDistinctValues
ko.utils.arrayIndexOf
ko.utils.arrayMap
ko.utils.arrayPushAll
ko.utils.arrayRemoveItem
ko.utils.extend
ko.utils.fieldsIncludedWithJsonPost
@jamesrcounts
jamesrcounts / MySqlCommandAdapter.cs
Created October 3, 2014 02:42
IDatabaseToExecuteableQueryAdaptor for MySql
// Note: Connection string must include the following option: Allow User Variables=True
using System;
using System.Data.Common;
using System.Linq;
using ApprovalUtilities.Persistence.Database;
using MySql.Data.MySqlClient;
public class MySqlCommandAdapter : IDatabaseToExecuteableQueryAdaptor
@sbarski
sbarski / gist:5a9e94632ff68e5dbd58
Created August 13, 2014 02:58
Schema for ASP.NET Identity Model 2.0
CREATE TABLE [dbo].[AspNetUsers](
[Id] [nvarchar](128) NOT NULL,
[Email] [nvarchar](256) NULL,
[EmailConfirmed] [bit] NOT NULL,
[PasswordHash] [nvarchar](max) NULL,
[SecurityStamp] [nvarchar](max) NULL,
[PhoneNumber] [nvarchar](max) NULL,
[PhoneNumberConfirmed] [bit] NOT NULL,
[TwoFactorEnabled] [bit] NOT NULL,
[LockoutEndDateUtc] [datetime] NULL,
@kensykora
kensykora / transform-all.bat
Last active December 31, 2020 16:58
Pre-Build event for T4 Transformation
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
:: set the working dir (default to current dir)
set wdir=%cd%
if not (%1)==() set wdir=%1
echo executing transform_all from %wdir%
:: create a list of all the T4 templates in the working dir
dir %wdir%\*.tt /b /s > t4list.txt
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@adamloving
adamloving / temporary-email-address-domains
Last active August 2, 2025 16:19
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com