ASP.NET MVC Assets 404 on Azure
Fresh azure deploy got you down because your images are 404ing?
Did you neglect to add them to the project?
Fresh azure deploy got you down because your images are 404ing?
Did you neglect to add them to the project?
I’ve previously written about how much I appreciate Rollbar. On my most recent side-project I wanted to integrate it into the ASP.NET MVC5 app I was building.
While Rollbar doesn’t have an official client, they suggest the open source RollbarSharp project.
Installing it is super easy:
Why isn’t EF saving changes?
If you’re following an older tutorial for ASP.NET MVC and/or Entity Framework,
but trying to apply it to the latest versions of the same, you may run into a
problem where your controller’s Edit
action doesn’t actually save any edits
to the database.
Visual Studio 2013 (Essentials or not, I don’t suppose it matters) provides the
ability to add SASS files (.scss
) to your project. Strangely, it doesn’t
give you the ability out of the box to compile them!
Now before you go attempt to install the Windows version of ruby (which is impossible by the way), let me demonstrate how to get automatic compilation in Visual Studio. Just for you, I’ve done the requisite frantic googling, spelunking through StackOverflow comments, and sacrificing to ancient pagan deities, all to find the hidden clue pointing out the right direction.
Because I love you.
EDIT: 2014-07-03 MSDN just posted a blog shedding light on why this change was introduced. Long story short, Google likes breaking things for you.
If you’re following the tutorial Deploy a Secure ASP.NET MVC 5 app with Membership, OAuth, and SQL Database to an Azure Web Site you may get this error when you get to the Google auth section.
The two parameter overload is a new feature in Microsoft.Owin.Security.Google
version 2.1.0.
You just need to upgrade the nuget package.1
Browserify is a pretty slick tool that lets
developers use node.js-style require
s in their browser-deployed javascript.
This gives significant advantages such as importing libraries from the
thousands available on npm or being able to run unit
tests headlessly in node.
Using a module system like Browserify and require
is one of the many
techniques that help javascript developers craft modular code that doesn’t
accidentally leak variables into the global scope. But sometimes the whole
purpose of a library is to do exactly that: export a namespaced set of
objects that other scripts can use. If all of the developer’s code is hidden
inside a closure and accessed internally through require
, how can other third
party scripts use the library?
At work we use a rather old, homegrown, erratic error reporting system. Basically every error any site or system encounters gets emailed out to the developers mailing list. Everyone has nasty Exchange filters to dump thousands of emails into a PHP Crap folder; emails that are neither actionable nor assignable.
The filters never work perfectly and inevitably filter something they shouldn’t and suddenly all the business folk are breathing down your neck about why the site doesn’t work and you’re left scratching your head and muttering to yourself about how it works fine on my machine, dammit.
Life’s too precious for this.
The hackernewsletter today linked to the Wikipedia article on Benford’s Law, which is a rather interesting topic.
Benford’s Law holds that in many common data sets, the distribution
of the first digit of each member of the set forms a gentle curve, wherein
about 30% of the numbers start with the digit 1 down to about 5% starting with
0.
I was curious to see what other data sets might fit within this distribution.
Just a few ruby scripts away!
AKA Fix Heartbleed in all my RVM managed rubies.
Assumes you’re using RVM with homebrew as your autolibs.
# Updates OpenSSL and then recompiles and installs all your RVM managed rubies:
$ brew update
$ brew upgrade openssl
$ rvm list strings | while read RUBY; do rvm reinstall --disable-binary $RUBY; done
This will take a while.
After its done, you should be able to run
$ ruby -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
with each ruby and have it print out OpenSSL 1.0.1g 7 Apr 2014
I was recently testing the pagination of a certain page on my site. I only wanted to show 12 records at a time. The simple test was to spin up 15 records and then assert that only 12 were assigned in the controller.
models_controller_spec.rbdescribe 'pagination' do it 'only shows 12 records' do 15.times { FactoryGirl.create(:model) } get :index expect(assigns(:models).length).to eq 12 end end
Eventually I added a static block of 3 “featured” records to the top and therefore only needed to paginate 9.
I changed the controller and hit save, only to watch my tests turn red.