This file contains hidden or 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
using System; | |
using System.Speech.Synthesis; // Add System.Speech from Add Reference | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Write("Enter your name: "); | |
var name = Console.ReadLine(); | |
This file contains hidden or 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
[TestFixture] | |
public class FooController_Tests | |
{ | |
FooDbContext _dbContext = new FooDbContext(@"SERVER=(localdb)\v11.0; DATABASE=FooControllerTests_"+ Guid.NewGuid().ToString("n")); | |
[TestFixtureSetUp] | |
public void Setup() | |
{ | |
_dbContext.Database.CreateIfNotExists(); | |
} |
This file contains hidden or 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
-- Do a backup to iTunes and open "%APPDATA%\Apple Computer\MobileSync\Backup\*\3d0d7e5fb2ce288813306e4d4636395e047a3d28" as a SQLite database | |
SELECT chat.chat_identifier, message.is_from_me, datetime(message.date + 978307201, 'unixepoch') as date, message.text | |
FROM chat | |
JOIN chat_message_join on chat.ROWID = chat_message_join.chat_id | |
JOIN message on message.ROWID = chat_message_join.message_id | |
order by message.date |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Routing; | |
public static class RouteUtils | |
{ | |
/// <summary> | |
/// e.g. <code>var routeData = RouteTable.Routes.GetRouteDataForPath("~/foo/bar");</code> |
This file contains hidden or 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
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace ZipReducedOneFile | |
{ | |
class Program | |
{ | |
static void Main() |
This file contains hidden or 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
[].map.call(document.querySelectorAll('iframe[name=reminders]')[0].contentDocument.querySelectorAll('.reminder-not-completed-view .reminder-row .reminder-title'), function(el) { | |
return el.textContent; | |
}).join('\r\n'); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Collections.Concurrent; | |
using System.Reflection; | |
static class ReflectionUtil | |
{ | |
static ConcurrentDictionary<PropertyInfo, Func<object, object>> _propertyGettersCache = new ConcurrentDictionary<PropertyInfo, Func<object, object>>(); |
This file contains hidden or 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
using System; | |
using System.Web; | |
// ... | |
namespace Foo | |
{ | |
public class MyWebApp : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
var cbm = new System.Web.Compilation.ClientBuildManager(HttpRuntime.AppDomainAppId, null); |
This file contains hidden or 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
:: tracks all branches for a remote e.g. `git branch --track origin/foo foo` | |
:: based on info from http://stackoverflow.com/questions/67699/clone-all-remote-branches-with-git | |
git branch -r | for /f "delims=/ tokens=1,*" %%A IN ('find "origin/"') do ( | |
@git branch --track %%A/%%B %%B | |
) | |
This file contains hidden or 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
<%@ Page Language="C#" %> | |
<ul> | |
<% foreach (DictionaryEntry item in Environment.GetEnvironmentVariables()) { %> | |
<li><%:item.Key%>: <code><%:item.Value%></code></li> | |
<%}%> | |
<ul> |