This is just a spot to keep miscellaneous links. It also shows you what a geek I am.
Saturday, December 05, 2015
How StackOverflow does caching
StackOverflow went down for a few hours earlier today, so I was able to read up on how they do caching here: http://meta.stackexchange.com/questions/69164/does-stack-exchange-use-caching-and-if-so-how
Tuesday, December 01, 2015
Git TFS with Git 2.5 and above - Solved!
I experienced the same issues as the OP here: https://github.com/git-tfs/git-tfs/issues/845
In my case:
This is documented in the release notes here: https://github.com/git-for-windows/build-extra/blob/master/installer/ReleaseNotes.md#known-issues
In my case:
$ git tfs clone https://me.visualstudio.com/DefaultCollection/_versionControl $/MyProject TFS repository can not be root and must start with "$/". You may be able to resolve this problem. - Try using $/C:/Program Files/Git/MyProject
The solution, courtesy of dscho: an msys2 flag that looks like the most bastardized bash syntax in the world, but apparently works. (Is this valid bash or a special msys2 thing?)
$ MSYS_NO_PATHCONV=1 git tfs clone https://me.visualstudio.com/DefaultCollection/ $/MyProject Initialized empty Git repository in C:/Projects/MyProject/.git/
EDIT:
You can also double up the initial quote after the $, e.g.:$ git tfs clone https://me.visualstudio.com/DefaultCollection/ $//MyProject Initialized empty Git repository in C:/Projects/MyProject/.git/
Tuesday, January 27, 2015
Doug Crockford on Monads and JavaScript
He's not the father of JavaScript, he's more the strongly opinionated caretaker.
Here is his fascinating YouTube video on JavaScript and Monads.
Here is the sourcecode: https://github.com/douglascrockford/monad
He covers four monads in the talk:
Two links he mentions
Here is his fascinating YouTube video on JavaScript and Monads.
Here is the sourcecode: https://github.com/douglascrockford/monad
He covers four monads in the talk:
- The Identity Monad
- The Ajax Monad
- The Maybe Monad, which eliminates the possibility of a null -- very cool!
- The Promise Monad, which apparently is not agreed upon by all to be a monad
Carl Hewitt, inventor of the Actor Model
Mark Miller, Secure Distributed Programming with Object-capabilities in JavaScript
How to Page in ASP.NET Web API
Great article. There are several ways of doing it, including the Twitter way, which handles infinite feeds in real-time scenarios using cursors.
Paging in ASP.NET Web API: Introduction | Jerrie Pelser
Paging in ASP.NET Web API: Introduction | Jerrie Pelser
Cool Visual Studio Extensions From Mads Kristensen
Mads, the author of the essential Web Essentials extension for Visual Studio, has created a number of other plugins and extensions as well. Here's a link to two blog posts by him describing these extensions.
New handy Visual Studio extensions
New handy Visual Studio extensions - part 2
New handy Visual Studio extensions
New handy Visual Studio extensions - part 2
Monday, January 26, 2015
Learn F# or Haskell?
Here's a side-by-side comparison of ML dialects, of which F# is one, with Haskell:
Then there are the various "99 Bottles" F# implementations. Interestingly, Don Syme's is one of the longer version. He is the creator of F# and arguably knows it the best.
Here's the Haskell version:
ML Dialects and Haskell: SML, OCaml, F#, Haskell - Hyperpolyglot
Then there are the various "99 Bottles" F# implementations. Interestingly, Don Syme's is one of the longer version. He is the creator of F# and arguably knows it the best.
99 Bottles of Beer | Language F#
Here's the Haskell version:
99 Bottles of Beer | Language Haskell
Friday, January 23, 2015
ASP.NET - don't minimize files if you're bundling!
If you've got bundling turned on, the ASP.NET bundling library will choose the already minimized instead of minimizing it at runtime. This can cause problems if you have updated the the source file -- file.js or file.css -- and you haven't remimized it.
So don't minimize the file in the IDE. Alternatively, set up some sort of automation that will automatically minimize the file or your minimized CSS and JavaScript files will be out of sync and your won't know why.
See this StackOverflow question: ASP.NET Bundling - Bundle not updating after included file has changed (returns 304 not modified)
So don't minimize the file in the IDE. Alternatively, set up some sort of automation that will automatically minimize the file or your minimized CSS and JavaScript files will be out of sync and your won't know why.
See this StackOverflow question: ASP.NET Bundling - Bundle not updating after included file has changed (returns 304 not modified)
Thursday, January 22, 2015
Adding only non-whitespace changes in Git.
Sometimes it's useful to add only the non-whitespace changes because typically they'll be the meaningful content. This StackOverflow question show how to do that.
Here's the command to add everything, ignoring whitespace-only changes:
Link here: http://stackoverflow.com/questions/3515597/git-add-only-non-whitespace-changes
Here's the command to add everything, ignoring whitespace-only changes:
git diff -w | git apply --cached --ignore-whitespaceLink here: http://stackoverflow.com/questions/3515597/git-add-only-non-whitespace-changes
Wednesday, December 10, 2014
Properly serving SVG files in IISExpress
If you just edit your web.config file it will actually break your website under IISExpress. Instead, follow the instructions found here: http://tomasmcguinness.com/2011/07/06/adding-support-for-svg-to-iis-express/
- Open a console application with administrator privileges.
- Navigation to the IIS Express directory. This lives under Program Files or Program Files (x86)
- Run the command
appcmd set config /section:staticContent /+[fileExtension=’svg’,mimeType=’image/svg+xml’]
Wednesday, November 05, 2014
Git line ending fixups revisited
I blogged about this a few years ago. I discovered how to do this when using
I have a
The sequence of commands is the following:
First, add all changed files: Then, edit the
.gitattributes, which is automatically created when you use Visual Studio to create a project that uses git as its version control system.I have a
.gitattributes file that contains (among other things) this line at the top:The sequence of commands is the following:
First, add all changed files: Then, edit the
.gitattributes file to comment out the "text=auto" line and save this file:
Then issue this command to un-stage all the files. It doesn't matter whether some of the files have meaningful changes. You're not resetting or undoing any file edits, you're merely removing them from the index:
Finally, restore the "text=auto" line in your .gitattributes file and save that file:
You should be all set. If you issue a git status command again you should see only the files that have meaningful changes, if any.
Thursday, October 23, 2014
Friday, September 26, 2014
Beyond SOLID: The Dependency Elimination Principle
http://qualityisspeed.blogspot.com/2014/09/beyond-solid-dependency-elimination.html
Last post I explained why I don't teach the SOLID design principles. Read the post for more detail, but the primary reason is that SOLID encourages heavy use of dependencies. Applying SOLID to a codebase for even a short time will yield dependencies on abstractions everywhere -- quickly producing a codebase that is unintelligible.
Friday, September 05, 2014
git cherry
My mnemonic for git cherry, i.e. git cherry upstream [head]
My quick understanding is that in many cases it means: show me everything that's NOT in upstream.
In other words:
git cherry branch-without-stuff branch-with-stuff
or
git cherry less-stuff more-stuff
or
git cherry present future
or
git cherry past present
So to see what's in develop but not yet in master, type this:
git cherry master develop
Which means, essentially, show me everything in develop that's not (yet) in master.
My quick understanding is that in many cases it means: show me everything that's NOT in upstream.
In other words:
or
git cherry less-stuff more-stuff
or
git cherry present future
or
git cherry past present
So to see what's in develop but not yet in master, type this:
git cherry master develop
Which means, essentially, show me everything in develop that's not (yet) in master.
Wednesday, August 20, 2014
Strongly-typed function callbacks in TypeScript
The question: http://stackoverflow.com/questions/14638990/are-strongly-typed-functions-as-parameters-possible-in-typescript
In TypeScript I can declare a parameter of a function as a type Function. Is there a "type-safe" way of doing this that I am missing?My favorite answer: http://stackoverflow.com/a/24034429/53107 from Drew Noakes:
Here are TypeScript equivalents of some common .NET delegates:interface Action<T> { (item: T): void; } interface Func<T,TResult> { (item: T): TResult; }
Renaming a remote branch in Git
I don't quite understand this, but I'll post it here anyway. It comes from StackOverflow user sschuberth.
Example:
Source: http://stackoverflow.com/a/21302474/53107
git push <remote> <remote>/<old_name>:refs/heads/<new_name> :<old_name>
Example:
git push origin origin/hotfix/Cant-load-assembly.0:refs/heads/feature/Fix-cant-load-assembly :hotfix/Cant-load-assembly.0
Source: http://stackoverflow.com/a/21302474/53107
Monday, August 18, 2014
Inspecting AngularJS $scope using Firebug and Chrome Developer Tools
The key part:
From: http://blog.alexonasp.net/post/2014/05/27/Inspecting-AngularJS-24scope-using-Firebug-and-Chrome-Developer-Tools.aspx
angular.element($0).scope()
From: http://blog.alexonasp.net/post/2014/05/27/Inspecting-AngularJS-24scope-using-Firebug-and-Chrome-Developer-Tools.aspx
Wednesday, July 30, 2014
Friday, June 20, 2014
Git - Refreshing a repository after changing line endings
Who knew? My repositories sometimes contain problematic commits that are just about fixing up line endings, but here's a solution to that from GitHub. (I haven't tested it yet.)
Refreshing a repository after changing line endingsHere's the StackOverflow post from which GitHub gets their answer. There's also something interesting about removing the index, which I never knew about.
Trying to fix line-endings with git filter-branch, but having no luck
Thursday, April 10, 2014
Use Date Based File Archiving with NLog
My quick and dirty way of doing it. The target tag is the most relevant part if you're already using NLog.