++ //Avoid public methods not publicly visible +// Matched methods are declared public but are not publicly visible by assemblies consumers. +// Their visibility level must be decreased. + +warnif count > 0 +from m in JustMyCode.Methods where + !m.IsPubliclyVisible && m.IsPublic && + + // Eliminate virtual methods + !m.IsVirtual && + // Eliminate interface and delegate types + !m.ParentType.IsInterface && + !m.ParentType.IsDelegate && + // Eliminate default constructors + !(m.IsConstructor && m.NbParameters == 0) && + // Eliminate operators that must be declared public + !m.IsOperator && + // Eliminate methods generated by compiler + !m.IsGeneratedByCompiler +select m + ++ +## NDepend: Code Dependency Management + +The other feature, and its probably more of a series of features is how NDepend manages code dependency. This does this with some awesome interactive graphs. The [documents](http://www.ndepend.com/Doc_VS_Arch.aspx#Dep) show pretty much all the graphs, and I wont get into it all, but from a high level they provide great visualizations of your code. + +>Graphing everything from class inheritance, to dependency graphs NDepend brings a new level of graphing to code quality tools. + +The tool allows you to find poor architectural decisions, and helps you correct them in the early days. Before the bad design decisions really bite you. + +## But wait there's more! + +If you thought this was a simple visual studio plugin, you would be wrong. + +>Having code quality in the build system is a must. I have always made sure code quality was also being measured in my CI pipline, and you should to. + +NDepend plugs into your build system to provide long term trend reporting. These reports can include LOC trends, which are compared against rule violation trends. NDepend reports can show your Test code coverage, code complexity, and code composition as your application matures. + +With an optional separate GUI, command line tool, and pluggable rules engine, NDepend provides a new level of code quality management. + + +## tl;dr? + +NDepend is a code quality tool that really shows your code smells in new ways. with long term trend reporting, heat maps, and more graphs than you will ever need. NDepend will help your team grow a codebase that is clean, and free from dodgy code. diff --git a/content/blog/Must-have-tool-LinqPad.md b/content/blog/Must-have-tool-LinqPad.md new file mode 100644 index 0000000..5084a84 --- /dev/null +++ b/content/blog/Must-have-tool-LinqPad.md @@ -0,0 +1,36 @@ +--- +title: 'Must have tool: LinqPad' +tags: + + - csharp + - must have tool + - tools + - review +permalink: /must-have-tool-linqpad/ +id: 28 +updated: '2014-04-16 06:22:43' +date: 2014-04-15T02:59:46.000Z +--- + +[LinqPad](http://linqpad.net) is an interactive C#/F#/VB.NET scratchpad that lets you run arbitrary C#/F#/VB.NET code, and also lets you query databases with linq. + +## What did that method do again? + +We have all been there....its way past your bedtime, and you cannot for the life of you remember what happens when string.Concat is called. You could try to just run something quick in your project to find out, but that would take time to build. You could google the result, and hope you can find the answer quickly....Or you can open linqpad and run the method! + + + +Ok of course you would never forget about string.Concat, but what about a method in a .dll? Well it can do that too! + +## Quickly, I can't figure out the SQL Codez! + +Ok so if you are like myself you probably suck at SQL...I was once good until I saw the Linq light...only dynamically creating linq queries is never as good as having real stored procedures. The [Linq Website](https://www.linqpad.net/WhyLINQBeatsSQL.aspx) has more examples of using SQL with linqpad than I could ever come up with. + +To put it simply writing in linq is far more expressive than SQL. If I need to write a complex SQL query I usually Figure out the linq query, and when I am happy with the results, I click the SQL button. Magically linqpad returns the SQL code for the linq query! + +## Can I debug my dll's ran in LinqPad using Visual Studio? + +Believe it or not...you can...Linqpad will easily import and run dll's. Once you have pointed linqpad to dll files, and imported the namespaces, you will be good to go. To attach visual studio as a debugger simply click debug, attach to process, and click on the linqpad process, with the proper project for debugging open. Once you start running your dll's in linqpad, the debugger will pickup what you are doing and stop the process at any linebreaks. The great part about this, is you can debug class libraries with linqpad without having to fire up a secondary project to run the code in. + +## TL;DR? +Linqpad converts linq to sql, and runs your .NET code from a simple scratchpad...If you suck at sql, or you want to quickly test something LinqPad rocks! diff --git a/content/blog/Navigating-the-JavaScript-waters-in-2015.md b/content/blog/Navigating-the-JavaScript-waters-in-2015.md new file mode 100644 index 0000000..4ae5fd7 --- /dev/null +++ b/content/blog/Navigating-the-JavaScript-waters-in-2015.md @@ -0,0 +1,49 @@ +--- +title: Navigating the JavaScript waters in 2015 +tags: + + - node.js + - javascript +permalink: /navigating-the-javascript-waters-in-2015/ +id: 48 +updated: '2015-09-01 20:18:27' +date: 2015-09-01T23:39:41.000Z +--- + +In this last year I have done much more JavaScript development than I have before. The landscape, and tools have exploded over the last few years. Gone are the days of JQuery widgets, and come forth have advanced virtual dom libraries, JavaScript servers, and multiple package managers. Along with new language features. + +## Node.js and io.js + +Right now there are two versions of Node.js. Although fairly soon the code bases will [merge back together](http://thenextweb.com/dd/2015/06/16/node-js-and-io-js-are-settling-their-differences-merging-back-together/). + +For those of you whom don't know, node.js is a server side JavaScript environment. io.js was a recent fork of the node.js code base to include newer language features, and updated versions of V8. + +In the long run both of these runtimes will merge to make the Node Foundation. In the short term I'd stick with node, unless you have a compelling reason to use io. + +## Package Management + +* [Bower](http://bower.io/) - Simple package manager to download files and place them on the file system. + +* [jspm](http://jspm.io/) - Client side focused package manager + +* [npm](https://www.npmjs.com) - Package manager mostly focused on shipping CommonJS modules, mostly for node.js + + +## Modules + +Modules are a pattern that encapsulates JavaScript code so scripts do not have to rely on the global namespace, but instead reference the file definitions. + +* CommonJS essentially defines module patterns with the use of an exports object. +* [AMD](http://requirejs.org/docs/whyamd.html) is a module definition designed for files to be downloaded separately, with the browser in mind. + +## Great libraries to mention + +These are some of the libraries I have liked. I'm sure I am leaving out many great others. + +* [Babel](https://babeljs.io/) - ES6 to ES5 transpiler. People use this to write ES6 code, and have it recompile to ES5 for use with older browsers. +* [ReactJS](http://facebook.github.io/react/) Client-Side framework for building UI's. Reacts strength is a Virtual DOM system that figures out what to alter in the UI, and just alters those elements, instead of altering the whole document. +* [Mithril](https://lhorie.github.io/mithril/) - Client Side MVC with Virtual DOM diff system (akin to ReactJS) +* [Tungstenjs](https://github.com/wayfair/tungstenjs) Virtual DOM system using Mustache server side, with plugins for backbonejs and ambersandjs client side. +* [Browserify](http://browserify.org/) A library that bundles commonJS modules into a file for use with the browser. +* [Grunt](http://gruntjs.com/) JavaScript task runner similar to Ant or Rake +* [Gulp](http://gulpjs.com/) Much like grunt, a JavaScript task framework much like Rake diff --git a/content/blog/New-Series-Windows-myths-debunked.md b/content/blog/New-Series-Windows-myths-debunked.md new file mode 100644 index 0000000..986c8e1 --- /dev/null +++ b/content/blog/New-Series-Windows-myths-debunked.md @@ -0,0 +1,35 @@ +--- +title: 'New Series: Windows myths debunked!' +tags: + + - devops + - development + - dotnet + - windows +permalink: /windows-net-myths-debunked/ +id: 38 +updated: '2015-02-22 20:57:52' +date: 2014-11-04T06:39:59.000Z +--- + +Over the last 8 years the demand to scale has ever increased. + +>We have gone from curating machines like your favorite pets, and started spinning up, and destroying VM's at an ever increasing pace. + +As engineers the Unix like platforms, have always been easier to work with. Personally I enjoy linux, I love package managers, I love ssh, and configurations are much easier. That being said, lately I have been interacting a lot with Windows servers. + +2014 was my first year really attending a lot of conferences. One thing I have seen a lot at these conferences are misconceptions about Windows itself, and the .NET environment. Granted, I still love Linux a ton, but I also believe Windows is a viable platform to run on. + +This blog post starts a **series** of posts to convince people that Windows can be a viable platform. I'll also use this series to talk about things I like about .NET. Personally, I believe azure has proven the viability of using windows on a large scale. + +## Package Management + +> When I want to install xyz program on my linux box, I just type apt-get package name, like to see you do that on windows! ~ SomeRandomDude + +This is the most common thing I have heard. I would like to direct **everyone's** attention to an amazing open source project called [Chocolatey](https://chocolatey.org/) + +Chocolatey is a package manager for windows. Much like apt-get, chocolatey can download and install packages from the chocolatey website, or a locally hosted store. + +The cool part about chocolatey? Completely open sourced, and driven by the community! Chocolatey was not developed at microsoft, but some engineers whom simply wanted apt-get like functionality in windows. + +Microsoft is now embracing this effort, in the next version of [Windows Management Framework](http://blogs.technet.com/b/windowsserver/archive/2014/04/03/windows-management-framework-v5-preview.aspx) Microsoft will release OneGet, a repository manager for windows. Under the bonnet driving OneGet by default, Chocolatey! Much like apt, to simply install puppet I can type `choco install puppet`. diff --git a/content/blog/Optimizing-Heroku-Cache-For-JS-Monorepos.md b/content/blog/Optimizing-Heroku-Cache-For-JS-Monorepos.md new file mode 100644 index 0000000..dae8b06 --- /dev/null +++ b/content/blog/Optimizing-Heroku-Cache-For-JS-Monorepos.md @@ -0,0 +1,90 @@ +--- +title: Optimizing heroku's node_module cache for JS monorepos +tags: +- js +- javascript +- heroku +- cloud +- devops +- node.js +date: 2021-10-12T04:00:00.000Z +--- + +For many of us a JS workspace is the simplest way to structure code for future growth while providing very quick iterations. Incase you are unfamiliar, several technologies exist such as `yarn workspaces`, `lerna`, `npm workspaces`, etc. That can seamlessly stitch npm packages on disk as though they were published to a private NPM registry. This allows for fast iteration inside of a single git repo, while allowing a future where these dependencies could be abstracted. + + + +The file system looks something like the following + +``` +root/ + packages/ + server + workers + data + utils +``` + +In my quick example we can pretend that an express app in in server, and some background workers are in workers. However both apps need to share code. One strategy would be to version the `data`, and `utils`, packages and ship them to a private NPM registry, or we could use these mono-repo technologies so that `import utils from 'utils'` just works without the need for a remote package store. When installing node modules into a JS workspace the following can occur + + +``` +root/ + node_modules + packages/ + server/node_modules + data + utils + worker/node_modules +``` + +In the above scenario node modules are both resolved into the root package but also several layers deep. In heroku you can cache your `node_modules` to improve build speed. However the paths to these directories **must be declared prior to the build**. This becomes an issue when big mono-repos litter `node_modules` everywhere. + +I decided to write the following JS script to walk over the directories where `node_modules` could be placed and rewrite the root `package.json` file so those directories are explicitly declared. + + +```js +const glob = require('glob'); +const fs = require('fs'); +const path = require('path'); +// do not run this in the heroku build +// we treat this a bit more like a yarn lockfile +if(process.env.NODE_ENV !== 'production') { + glob("./packages/*/node_modules", {}, function (er, result) { + const packageJson = require('./package.json'); + // include the root node_modules + let cacheDirectories = ['node_modules']; + cacheDirectories = cacheDirectories.concat(result) + packageJson.cacheDirectories = cacheDirectories.filter(i => { + // ensure the directory node_modules are found contain a package.json file + return fs.existsSync(path.resolve(i, '../package.json')); + }); + // write out the changes to the root packaage.json + fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2)); + }) +} +``` + +I wired up the script on the post install process of the install lifecycle. Basically adding the following to the root `package.json` file. + +```json +{ + "scripts": { + "postinstall": "node ./computeCacheDirectories.js", + } +} +``` + +Now every time a developer runs `yarn install` they will compute the cache directories. The result is a mutation to the `package.json` that looks like the following. + +```json +{ + "cacheDirectories": [ + "node_modules", + "./packages/server/node_modules", + "./packages/worker/node_modules" + ], +} +``` + +When we push changes to prod we get much better cache hits across our yarn workspace. \ No newline at end of file diff --git a/content/blog/Parsing-and-Nesting-Models-in-backbone-js.md b/content/blog/Parsing-and-Nesting-Models-in-backbone-js.md new file mode 100644 index 0000000..e24be7b --- /dev/null +++ b/content/blog/Parsing-and-Nesting-Models-in-backbone-js.md @@ -0,0 +1,48 @@ +--- +title: 'Parsing, and Nesting Models in backbone.js' +tags: + + - development + - backbone.js + - javascript + - tutorial +permalink: /nested-models-in-backbone-js/ +id: 13 +updated: '2014-03-02 20:28:44' +date: 2014-02-24T07:18:51.000Z +--- + + +## The Parse Function +The parse function allows you to do some pre-processing of the data sent from the server before the model is created. Parse should return an object containing the values that will make up this models attribues. This is called after the fetch command has recieved the data, but before the response is put into the model. The example below parses dates to local time before adding them to the model using [moment](http://momentjs.com/). + +```javascript + +namespace.Model = Backbone.Model.extend({ + urlRoot: '/api/', + parse: function(response, options){ + var attr = {}; + attr.date = moment().utc(response.date).local() + attr.OtherData = response.OtherData + return attr; + } +}); +``` + +## Nesting Models (aka model within a model) + +We will use the same parse function as above to create models within this model from data retrieved by the server. You could even loop through an array's keys and values to convert them to a model if need be. + + +```javascript + +namespace.Model = Backbone.Model.extend({ + urlRoot: '/api/', + parse: function(response, options){ + var attr = {}; + var submodel = new namespace.otherModel({value1: response.subModelArray.value1, value2: response.subModelArray.value2 }); + attr.SubModel = submodel; + return attr; + } +}); +``` diff --git a/content/blog/Parsing-cli-arguments-in-dotnet-core-Console-App.md b/content/blog/Parsing-cli-arguments-in-dotnet-core-Console-App.md new file mode 100644 index 0000000..ac6516d --- /dev/null +++ b/content/blog/Parsing-cli-arguments-in-dotnet-core-Console-App.md @@ -0,0 +1,444 @@ +--- +title: Parsing cli arguments in dotnet core Console App +date: 2016-10-24T20:31:06.000Z +tags: + - csharp + - dotnet + - console +--- + +**tl;dr** view [this gist](https://gist.github.com/TerribleDev/06abb67350745a58f9fab080bee74be1) + +So its 2016, and we are still making console apps/cli's. In fact I would say there has been a surge in popularity of these types of tools. I think we have come to the realization that buttons on forms are not automatable, and that the command line doesn't have to be scary. + +I recently started writing an app in dotnet core, which is the new runtime for dotnet. In the past I have often used [command line parser](https://www.nuget.org/packages/CommandLineParser), but as of this writing it does not support core. + +> I was really lost trying to find an arguments parsing library when I realized the dotnet cli was open sourced. + +After much struggle, failing to bingle. I started ripping through the Entity Framework, and dotnet cli's code hoping to find a gem. Thats when I stumbled across a [diamond](microsoft.extensions.commandlineutils). You see many dotnet projects use [Microsft.Extension.CommandLineUtils](https://www.nuget.org/packages/Microsoft.Extensions.CommandLineUtils/) to do cli parsing. + + + +## A quick primer on the command line + +Console apps are just essentially apps that use the console as the UI. The primary way developers interact with CLI tools is through the console. Lets take the azure cli and break down how commands work as an interface. + + +``` +info: _ _____ _ ___ ___ +info: /_\ |_ / | | | _ \ __| +info: _ ___/ _ \__/ /| |_| | / _|___ _ _ +info: (___ /_/ \_\/___|\___/|_|_\___| _____) +info: (_______ _ _) _ ______ _)_ _ +info: (______________ _ ) (___ _ _) +info: +info: Microsoft Azure: Microsoft's Cloud Platform +info: +info: Tool version 0.10.6 +help: +help: Display help for a given command +help: help [options] [command] +help: +help: Log in to an Azure subscription using Active Directory or a Microsoft account identity. +help: login [options] +help: +help: Log out from Azure subscription using Active Directory. Currently, the user can log out only via Microsoft organizational account +help: logout [options] [username] +help: +help: Open the portal in a browser +help: portal [options] +help: +help: Manages the data collection preference. +help: telemetry [options] +help: +help: Commands: +help: account Commands to manage your account information and publish settings +help: acs Commands to manage your container service. +help: ad Commands to display Active Directory objects +help: appserviceplan Commands to manage your Azure appserviceplans +help: availset Commands to manage your availability sets. +help: batch Commands to manage your Batch objects +help: cdn Commands to manage Azure Content Delivery Network (CDN) + +``` + +The azure cli has what many consider a noun verb syntax. For example if I run `azure webapp` I will have a list of actions to take on the webapp noun. I could run `azure webapp list` or `azure webapp start [appname]`. These are what we call Commands. + +``` + +C:\Users\parne>azure webapp +help: Commands to manage your Azure webapps +help: +help: create a web app +help: webapp create [options]
@jdcooke0117 Like off the bottom of the charts? Because you couldn't even run ES before but now you can?
— Norm MacLennan (@nromdotcom) October 1, 2015
+
+
+I got curious as ES usually stands for Elasticsearch, and I quickly found out that AWS [announced](https://aws.amazon.com/blogs/aws/new-amazon-elasticsearch-service/) Elasticsearch as service.
+
+This was pretty huge for me since a few months before I struggled to string together some code that someone else at my company wrote to get elasticsearch working in AWS, and to be honest it was not fun. Managing elasticsearch in AWS is far from great.
+
+
+We started out with a basic 'domain' (which is AWS' term for an elasticsearch cluster) and we got up and running pretty fast. The 'domains' seemed to have almost all the API's we needed, and it worked with the [NEST client](http://nest.azurewebsites.net/).
+
+When we were just trying it out we didn't bother securing it, but when we needed to secure the instance, we realized things were not so fun. AWS lets you block access by ip which doesn't help because EC2 instances have different ip addresses as the time, or you can use IAM roles, except you can't just target existing machines you have to sign the requests.
+
+Eventually we bit the bullet and decided to sign our requests to the cluster. Unfortunatly the SDK doesn't provide a utility to sign any ol' http requests. I started digging through the AWS docs to figure out how to sign requests, and I was getting worried, as the docs do not make it seem easy to pull off. As an act of desperation I dived into nuget and just typed aws elasticsearch, which I then stumbled across a [project that was published only days before](https://github.com/bcuff/elasticsearch-net-aws).
+
+This project totally saved my bacon. Brandon's library plugged right into the .NET sdk, and auth'd our requests to aws without us having to figure out all that crypo. Within moments of finding it I filed an [issue](https://github.com/bcuff/elasticsearch-net-aws/issues/1) thanking Brandon as it really helped me out.
+
+The Elasticsearch service offering by Amazon is pretty awesome. Like any platform its less flexible then hosting the instances yourself. You have to live with the plugins they ship, but on the plus side you get a full cluster, with monitoring, and a knob to turn up instances, or storage space without having to worry about the details.
diff --git a/content/blog/Serving-AMP-Pages-with-dotnet-core.md b/content/blog/Serving-AMP-Pages-with-dotnet-core.md
new file mode 100644
index 0000000..0b6691f
--- /dev/null
+++ b/content/blog/Serving-AMP-Pages-with-dotnet-core.md
@@ -0,0 +1,257 @@
+---
+title: Serving AMP Pages with Dotnet Core
+date: 2022-03-10T11:00:00.000Z
+tags:
+- dotnet
+- dotnetcore
+- amp
+---
+
+I remember when (Accelerated Mobile Pages) first came out, and it was very restrictive and weird. I think this ultimately hurt the *AMP Brand* Beyond this, several companies have built AMP experiences which haven't always been the best experience. I do however think AMP pages always load extremely fast. A lot of that is just the constraints of AMP. Last night I put my blog posts on AMP for a laugh, and it was much easier than I thought it would be.
+
+
+
+## Step 0
+
+Download the [AMP chrome extension](https://chrome.google.com/webstore/detail/amp-validator/nmoffdblmcmgeicmolmhobpoocbbmknc?hl=en) and read what your violations are on an existing page you want to serve as an amp page.
+
+
+
+## AMP Requirements
+
+So these days AMP is a webpage with several restrictions.
+
+* No JavaScript, or well very restrictive JS.
+ * JS is possible, but not without work. For the sake of this tutorial I decided to skip the JS.
+* Inlined only css
+* No `picture` tags
+* A few other tags you need for AMP.
+
+
+## Razor
+
+First things first, we need to figure out how we will adjust our layout for AMP. The easiest way for a layout to get a variable either from any controller or any razor page is using the `ViewData` dictionary. I added the following at the top of my layout page. This lets me read if we are in an amp page.
+
+```csharp
+@{
+ var amp = ViewData["amp"] as bool? ?? false;
+ var htmlTag = amp ? "amp" : "";
+}
+```
+
+Ok, so lets dive into the required HTML markup. AMP pages require a...
+
+* `` tag with an `amp` attribute.
+* a `` tag with an `++``` +Adding permissions is also easy: + +```csharp +[assembly: UsesPermission(Android.Manifest.Permission.Internet)] +``` + + +## Using Java Libraries +[Xamarin](http://xamarin.com/) provides some kind of crazy visual studio project, that will essentially provide c# bindings to Java libraries you require. To bind Simply create a Java Binding project, adding the .Jar files, and then build. Watch the magic happen. They do [note](http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)/) that you sometimes need to do some configuration for certain libraries, however I had no issues with the one I tried. On top of that if you really needed to, you could access the [Java Native Interface](http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/working_with_jni/) for even more power. diff --git a/content/blog/Xamarin-For-Android-The-Ugly-Part-3-of-4.md b/content/blog/Xamarin-For-Android-The-Ugly-Part-3-of-4.md new file mode 100644 index 0000000..d3ee146 --- /dev/null +++ b/content/blog/Xamarin-For-Android-The-Ugly-Part-3-of-4.md @@ -0,0 +1,39 @@ +--- +title: 'Xamarin For Android The Ugly: (Part 3 of 4)' +tags: + + - xamarin + - development + - review + - csharp + - xamarin for android +permalink: /xamarin-for-android-the-ugly-part-3-of-4/ +id: 8 +updated: '2014-02-20 13:15:28' +date: 2014-02-18T08:16:17.000Z +--- + +* [Part One](/xamarin-the-good-the-bad-and-the-ugly/) +* [Part Two](/xamarin-for-android-the-bad-part-2-of-4/) +* Part Three +* [Part Four](/xamarin-the-conclusion-part-4-of-4/) + +I had some problems with Xamarin. Somethings are ugly, but with plastic surgery almost anything can become beautiful. + +## Components + +Xamarin has its own software packages available for download. I tried a lot of them out, some were good others not so much. One of my biggest gripes was that Google Play Services currently has a [bug](http://stackoverflow.com/questions/20125720/xamarin-android-builds-deployments-are-very-slow-how-to-speed-them-up) that makes builds **really** slow. Other packages were either genius, or were simply unimpressive. The components have their own package manager, and it does do a decent job of keeping them in order. I have to admit though Xamarin has its own set of componants that do [in-app billing](http://components.xamarin.com/gettingstarted/xamarin.inappbilling), and [access phone data](http://components.xamarin.com/view/xamarin.mobile) without having to lift much of a finger. + + + +### Component Documentation + +A real put down is that only some of the components have adequate documentation. For instance for me to get [admob](http://www.google.com/ads/admob/) working with play services; I had to look at the Java documentation, and try to figure out how its supposed to be done on Xamarin. This wasn't to difficult, but admob is well used. I would have assumed the documentation would have covered it, but couldn't find anything. + +## Visual Studio Designer + +The Visual studio designer for Android at first seemed like the best thing since sliced bread! I was able to get a UI up and running in no time. Making my app work for tablets, and mobile phones alike was simple. However, once in a while it would be stubborn, and stop working. I'm not sure if it was something I was doing, but I felt like it would bomb out and I would have to restore the XAML file to continue. + +The editor really isn't great for designing ListViews, working with fragments, or making something that will scale easily. Often it made things exact pixel widths instead of using dots per inch. To keep it short, I still had to do plenty of editing of the source manually (which was not too bad). Making the theme stick on the default view was a pain, until I realized that I could ignore the editor, and decorate my MainActivity with the theme I wanted to use. + ++ ++ ++ +
[Activity(Label = "Label", MainLauncher = true, Icon = "@drawable/Icon", Theme = "@android:style/Theme.Holo.Light")]\ No newline at end of file diff --git a/content/blog/You-hired-adults-not-children.md b/content/blog/You-hired-adults-not-children.md new file mode 100644 index 0000000..8b1a634 --- /dev/null +++ b/content/blog/You-hired-adults-not-children.md @@ -0,0 +1,34 @@ +--- +title: 'You hired adults, not children' +tags: + + - culture + - continuous improvement +permalink: /you-hired-adults-not-children/ +id: 23 +updated: '2014-04-01 23:17:41' +date: 2014-03-15T08:17:54.000Z +--- + +One of the things that I often see in our industry is the culture of access control. Security measures are put into place, because you wish to restrict access to a certain thing. Systems like HRIS need such restrictions, as private information should not be publicly available to the company. However often systems that don't need security controls put into place end up having them. + +>Most people understand where they fall in the business, and the authority delegated to them. + +## Filtering Internet + +Filtering internet is a controversial topic in most work places. By actively monitoring your employees activities on the internet, they will feel a sense of distrust. If you trust this person to write code for your production website, you can probably trust them to surf at will. I'm not Advocating that you don't log the activity. However you shouldn't actively block websites, or read the logs. Activity Logs should only be used when legal problems arise, and **not** something you hang over your employee's heads. + + +## Ownership and Directed Management + +Let employees have ownership of their work. Let them understand that with the freedom to own things, comes the responsibility to that thing. Employees whom decide to use non-standard technologies, should have to own that thing entirely. Stopping them from using it can be a barrier to productivity, especially if that particular technology is best for their project. + +Asking someone to do something without context is demoralizing. Let employees know why you are asking them to do something. This establishes your motives, and gives that person a sense as to how they fit in the organization. If someone asks you to do something, and you are busy let them know why you can't fulfill their request at that moment. + +## Access Control: Barrier of productivity + +One of the huge problems in most companies are barriers to productivity. These can be caused by processes, but also access control. Most systems do not need have access control set around them. If you trust your employees, and colleagues to be adults, you should not have to lock them out of xyz system as long at that system does not store sensitive data. No one manager or even team should have to approve specific patches. Anyone who feels they have authority to approve something, should be able to do so. People fully understand the authority delegated to them. Waiting for specific people can be ultimately a huge barrier to success. + +## Overall Message + +There is nothing wrong with being a manager, but try to delegate responsibility to you're subordinates. Give them the trust and respect that they deserve. Employees whom are empowered are more antonymous and are ultimately more productive than their oppressed counterparts. diff --git a/content/blog/You-re-doing-it-wrong-Recruiter-Edition.md b/content/blog/You-re-doing-it-wrong-Recruiter-Edition.md new file mode 100644 index 0000000..c2befb0 --- /dev/null +++ b/content/blog/You-re-doing-it-wrong-Recruiter-Edition.md @@ -0,0 +1,53 @@ +--- +title: "You're doing it wrong! (Recruiter Edition)" +tags: + + - recruiting + - culture +permalink: /youre-doing-it-wrong-recruiter-edition/ +id: 5 +updated: '2014-02-20 05:56:05' +date: 2014-02-17T06:08:28.000Z +--- + +Recruiting, I am sure is a tough job (I wouldn't actually know), but often being on the other end I see pitfalls that a lot of recruiters fall into. So for all of you recruiters, please do not do these things. + +### The Linkedin Summary + +We all know that a major way to find candidates is through social media, the top one is [Linkedin](http://linkedin.com). Linkedin allows you to instantly find candidates that have the skills you are looking for. + +In Linkedin the summary is really a place for a person to express who they are, where they would like to be in 5 years, and how they wish to get there. This is usually a good place where people leave information for recruiters. + +If you find a candidate with qualifications that are suitable, spend the 5 minutes to read their summary. Their summary could include information that will help in your efforts to recruit this person. Showing that you spent the few minutes to read their summary in your initial contact message will go far. Ignoring their summary will most certainly be your recruitment downfall. + + +### The Problem + +At the end of the day, a developer wants to solve a problem. Developers want to solve interesting problems, or problems which not many people can solve. Sending an email saying *hey im looking for xyz candidate with experience in ruby* will probably not get much attention. + +Think for a moment about why you are hiring someone. You hire people, because your company has a problem, and that problem needs to be solved. + +Sending an email stating a problem you have, and why you need this person to help solve it, will ultimately prove better than a list of standard qualifications necessary for the position. + +Ultimately you should try to get them excited to work at your company. Free beer, and pizza is not a recruiting tool, just a way to disguise what could be a poor environment to work in. + +### First Contact + + + +#### Do +* Address the candidate with the name they have listed on websites/resumes +* Present clearly what you are looking for, and what you are not looking for +* Ask them what their future goals are +* Ask them if they know anyone whom would be interested (if they are not) +* Tell them why your company is worth working for. Be honest, provide stories from your own experiences +* Be honest about the job, they will leave if they find out it was not what you said it was + + +#### Don'ts +* Assume their name is a nickname (ex. addressing someone named Dave, as David) +* Contact someone asking for qualifications that are clearly not listed on their resume +* Being unprepared during an interview (phone or otherwise) +* Sell them your company with offers of free gifts (both before, and during employment) + +...and if they turn you down, be polite. Leave a lasting impression. You only get one shot to show your organizations value. Even if they turn you down, they may refer others to you. diff --git a/content/blog/You-re-doing-it-wrong-software-testing.md b/content/blog/You-re-doing-it-wrong-software-testing.md new file mode 100644 index 0000000..62ba201 --- /dev/null +++ b/content/blog/You-re-doing-it-wrong-software-testing.md @@ -0,0 +1,54 @@ +--- +title: "You're doing it wrong (software testing)" +tags: + + - culture + - testing + - non-prod + - continuous improvement +permalink: /softwaretesting/ +id: 11 +updated: '2014-02-22 08:38:47' +date: 2014-02-20T10:00:57.000Z +--- + +One of the major systems that will stop you from losing money is your testing environment. The ability to properly test patches before they are put into production is a must. + + +## Hardware Symmetry + +> Our test environment does not have nearly the same CPU/Memory that production servers have + +The discrepancy between test and and prod adds unnecessary variables to your testing. Your testing environment needs to be a mirror hardware-wise as your production environment. The ability to accurately test the memory increases, and CPU impact is critical to the success of your code in production. + +For instance if you have multiple worker processes in production, that each hold a cache of data and that cache is increased by 2GBb. This may be seen in a non-prod environment as a small increase. However, if your production environment is running 4 times the worker processes as your non prod the small 2GB rise becomes 8GB very quickly. + +This large increase in memory usage could destabilize your platform (or not), but the unpredictability of this fact is scary. Tests should be [scientific](http://en.wikipedia.org/wiki/Scientific_method), and a radical difference between the two environments causes unnecessary variables. + +## Testing in prod as a last resort + +>We can't test this in test, because our *(insert discrepancy of the day)* in test is not good enough + +If you suspect that a patch is causing performance problems, but you are unable to fully test it in a non-prod environment. Try to get the right hardware provisioned, or see what can be done for effective testing. The cost of serious performance degradation in production can be far worse than getting the right hardware, or pushing back at other developers. + +If you have to test in prod try to patch a few servers and see what happens. Going all the way can also be more costly, then applying something on a few machines and rolling back. Make sure that potentially destructive tests are performed when all teams are in the office. Provide communication, and get everyone involved. If testing in prod requires a pow-wow of 10+ people you will quickly see those kinds of tests end fast. + + + + + +## Learn from your mistakes + +>Continuous Improvement is not only an improvement of code, but also an evolution of philosophies. ~[Norm Maclennan](https://blog.normmaclennan.com) + +When problems occur in prod, you sometimes hear why did QA not catch this? When really the question should be, why was this not caught in test. One of the huge differences between these two statements is the first tries to blame a person, while the other constructively finds ways to improve and evolve. + +>Everyone in the organization should take ownership of testing, and testing environments. ~ [Tommy Parnell](http://about.tommyparnell.com) + +This is a huge key to success. Realize that if you write code, you probably write test cases. You should make sure you understand the release process, how code is tested, and how QA performs tests. Making sure QA can accurately test your code will ultimately prove beneficial to both you, your team, and your organization. + +##Inconsistent Releases + +Releases to test should be performed in the same manor as releases to prod. Any deviation from the documented process should be addressed immediately. Code changes should be managed properly, and scientifically for formal testing to be effective. + +Patches should also follow a consistent pattern from one software upgrade to the next. Hearing *this patch is going to be weird* from a Release Engineer is basically a red flag for *this is going to go wrong, but we don't want to take the blame for it* diff --git a/content/blog/c-when-should-I-use-the-stack-or-heap.md b/content/blog/c-when-should-I-use-the-stack-or-heap.md new file mode 100644 index 0000000..6125921 --- /dev/null +++ b/content/blog/c-when-should-I-use-the-stack-or-heap.md @@ -0,0 +1,36 @@ +--- +title: 'c++, when should I use the stack or heap?' +tags: + + - c++ + - performance +permalink: /c-strings/ +id: 57 +updated: '2015-10-18 11:00:24' +date: 2015-10-04T15:58:18.000Z +--- + +So I have started learning c++ recently, and as a .NET/Java developer I always want to write the following code. + +`var s = new myClass()`. + +In c++ you have to manage memory yourself, there is no garbage collector. + +If you do not use the new keyword `var s = myClass()` you will create that class and assign it to on the `stack`. + +Any stack variables will be cleaned at the end of the block, so in this case s will be cleaned. However if you use `var s = new myClass()` s will be allocated onto the **heap** and must be deleted, otherwise memory leaks will occur. + +To clean the variable you must call `delete` when you are done with the variable, this will cause the memory in the heap to be cleaned. + +Now this comes back to *what is a stack and heap* I wrote a [blog post](/value-types-vs-reference-types-in-c-and-why-it-matters/) about value and reference types in c# and this talk touches on a lot of the same subject. Basically a stack in c++ is a 1mb scratch pad of memory, that is really fast to access. The heap is a larger pool of memory for dynamic allocation, but can be slower to access. + +So I was thinking to myself, well when should I allocate on the stack vs heap. The stack is limited in size, and if you go over that size you will cause a stack overflow. Also I want my c++ app to be fast, so I would like to allocate on the stack often, and I don't have to worry about cleaning up stack objects. That being said the heap is still quite fast so I shouldn't avoid the heap. + +Consider any or all of the following rules to put objects into the stack. **Note:** You don't need to meet all of them. + +#### Stack Allocate: +* Immutable +* Under 32 bytes (Ideally around 16 bytes) +* It won't require being put into heap often +* Short Lived +* Embedded in other objects diff --git a/content/blog/dockerize-that-old-webforms-app.md b/content/blog/dockerize-that-old-webforms-app.md new file mode 100644 index 0000000..c3c518f --- /dev/null +++ b/content/blog/dockerize-that-old-webforms-app.md @@ -0,0 +1,63 @@ +--- +title: Dockerize that old webforms app +date: 2016-10-19T00:20:49.000Z +tags: + - docker + - dotnet +--- + +So now that Windows server 2016 is [generally avalible](https://blogs.technet.microsoft.com/hybridcloud/2016/10/12/another-big-step-in-hybrid-cloud-windows-server-2016-general-availability/) for the first time ever windows users can now use containers. Ok, so what exactly are containers? Well more or less they are virtual operating systems that **share** the same kernel as the host OS. In regular VM's the hardware is shared between machines, but containers go a step further and share the kernel of the OS. Why does this matter? Well because you are sharing an existing kernel that is already running, your startup times are instantanious. To put this in perspective, this is virtualization at the OS level. + +On Linux, containers have been a thing for a long time. This technology is called LXC. Docker itself is a layer ontop of various container platforms embedded in operating systems. + + + +## Getting started + +You can setup your windows 10 machine [with this script](https://gist.github.com/TerribleDev/dd424d3d090bcf5634dcf8417411a081). After docker starts, right click on it in the task bar and click Use Windows Containers. MSDN contains [docs](https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_server) for server 2016. + +So I have put an example project [together on github](https://github.com/TerribleDev/docker-webforms) which may help you understand what is going on. Docker images are first compiled which essentially involves taking an existing image, maybe running some commands (like installing windows features), and pushing your files into the container. After the image is built we can run the container, and beyond that we can publish the image for deployment. + +We define how the container is built with a `Dockerfile`. Take an existing webforms app, and in the web project add a file called `Dockerfile` with the following content + +Dockerfile: + +``` +FROM microsoft/aspnet +ARG site_root=. +ADD ${site_root} /inetpub/wwwroot + +``` + +In this case the `Dockerfile` is pulling down the aspnet image from Dockerhub. This is a servercore image, with iis/aspnet installed. Docker is adding the content in the current directory to /inetpub/wwwroot which is where the app is ran from in the container. + +Now compile your code and run the following in the root of your project directory + +```powershell +docker build -t mywebforms:0.0.1 . +``` + +You should now have an docker image created! We can list the docker images with `docker images`. We can run the image with `docker run -d mywebforms:0.0.1` + +To see the website running in the container we need to find its ip address and then open a browser to the ip. You can use this powershell script to list running docker procs and their ip's + +```powershell +docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" $(docker ps -qa) +``` + +## Ok so now what? + + + + +## Plumbing in a CI system! + + +Even legacy applications can be improved with some kind of build automation. Starting to automate msbuild/nuget and docker is a great start to really improving legacy projects. I am a web developer, so javascript is my bread and butter. that being said, its not for everyone. In [my sample project](https://github.com/TerribleDev/docker-webforms) I used gulp to compose a build together. There are many tools including cake (c#), albacore (ruby), grunt (javascript). Honestly they all work about the same. I chose gulp, because I am using gulp in many of my projects currently. + + +In my sample I created a gulp file that takes in a version number (which could be passed by our CI system). Patches the AssemblyInfo.cs files, restores nuget packages, and compiles down a docker image to be used later. All with the simple command of `gulp build --version 1.0.0` + +The created docker image could easily be uploaded to some kind of storage. + + diff --git a/content/blog/fifthpost.md b/content/blog/fifthpost.md deleted file mode 100644 index b173821..0000000 --- a/content/blog/fifthpost.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: This is a fifth post (draft) -date: 2023-01-23 -draft: true ---- -This is a draft post diff --git a/content/blog/firstpost.md b/content/blog/firstpost.md deleted file mode 100644 index 0557716..0000000 --- a/content/blog/firstpost.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: This is my first post. -description: This is a post on My Blog about agile frameworks. -date: 2018-05-01 -tags: - - another tag ---- -Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. - -Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. - -## Section Header - -Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. - -```diff-js - // this is a command - function myCommand() { -+ let counter = 0; -- let counter = 1; - counter++; - } - - // Test with a line break above this line. - console.log('Test'); -``` diff --git a/content/blog/fourthpost/fourthpost.md b/content/blog/fourthpost/fourthpost.md deleted file mode 100644 index 8149f7c..0000000 --- a/content/blog/fourthpost/fourthpost.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: This is my fourth post. -description: This is a post on My Blog about touchpoints and circling wagons. -date: 2018-09-30 -tags: second tag ---- -Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. - -Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. - -{% image "./possum.png", "A possum parent and two possum kids hanging from the iconic red balloon" %} - -## Section Header - -Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. - diff --git a/content/blog/fourthpost/possum.png b/content/blog/fourthpost/possum.png deleted file mode 100644 index f332150..0000000 Binary files a/content/blog/fourthpost/possum.png and /dev/null differ diff --git a/content/blog/iPhone-or-Android-From-a-guy-living-with-both.md b/content/blog/iPhone-or-Android-From-a-guy-living-with-both.md new file mode 100644 index 0000000..bd43e16 --- /dev/null +++ b/content/blog/iPhone-or-Android-From-a-guy-living-with-both.md @@ -0,0 +1,76 @@ +--- +title: iPhone or Android (From a guy living with both) +tags: + + - android + - smartphone + - phone + - iphone +permalink: /iphone-or-android-from-a-guy-living-with-both/ +id: 15 +updated: '2014-02-25 14:58:16' +date: 2014-02-25T00:29:43.000Z +--- + +I know, I know the very first question you ask is going to be *why do you have two phones*, the answer being One is for work, the other is for my personal life. Now that we are done with that subject, we can get on with the review... + +## Warning: I am a self-Proclaimed Android Fan-boy + +Before I really get into it, I will warn you all that I am apart of the Android User Master Race. Some bias opinion **will** occur. + +## What phones? + +I will mostly be reviewing the [iPhone 5c](http://www.apple.com/iphone-5c/), against the [Nexus 5](https://play.google.com/store/devices/details/Nexus_5_16GB_White?id=nexus_5_white_16gb&hl=en). + +## What no flashy graphs? + +Unlike most reviews this wont have a bunch of data touting the disk read speeds during mid-day under controlled duress. This is a simple review of my experience with the two devices. + +## Build Quality + +### iPhone 5c +The first time I held the 5c, I thought it felt like a kids toy. Although that feeling still lingers with me today, I have noticed since that the quality of the build is fantastic. The buttons feel like they were made to last 1000 years, and the plastic does not feel cheap. I get the feeling it would survive a nasty fall. Although the phone is small, it does not make me wish I had a bigger one. On a side note I was more blown away by the iPhone headphones. These ear buds are actually great value for $30 (free with iPhone). They sound amazing, and they can take a beating. I plug them into my Nexus 5 to make phone calls a lot. + +### Nexus 5 + +The Nexus 5 features a much bigger screen than the iPhone 5c, but not so large it does not make it harder to handle. The white back looks very nice, and the buttons feel solid. Power button on the side is my preference. My one gripe with it, is when you hold it you don't get the feeling you are holding the greatness of [google](http://google.com) in your hand. I'm not sure what hidden element I am talking about, but it feels pretty plain as you hold it. That being said I do feel like I can bend space-time with the phone. + +## Operating System + +### iPhone 5c + +We all know iOS is pretty much amazing to those who love apple. For me I have some gripes. + +* iPhone keyboard always shows capitalized letters, regardless if you are typing lower case or upper case +* I wish my home page was not the app tray +* The notifications pull down menu is not intuative, and sometimes clicking the close button is unresponsive + +### Nexus 5 + +Android OS is pretty awesome as well but there are some flaws. On a side note I'd like to say that touchwiz and other 3rd party customizations really make Android suck. The one thing that really impresses me about Android is the notifications menu. The menu is clean, and only notifies you on things you care about. If you want widgets, put 'em on the home screen. There is a real seperation of concerns in Android that feels missing in iPhone. + +* Some of the home screen widgets really eat battery life +* Some of the older Anroid applications feel out of place on newer devices *ie not using the holo theme* + + +## Finding Applications + + +I got to give this one to apple. I'm not sure of the Apple stores size, but I felt the store contained better quality apps. The Android app store is really good if you want [Confucius quotes](https://play.google.com/store/apps/details?id=com.Quotes.ConfuciusQuotes&hl=en), apps made in [3 days or less](https://play.google.com/store/apps/details?id=ultimategravatarsync.ultimategravatarsyncfree&hl=en), or apps that show hot asian babes. [Apple](http://www.apple.com/) has done a good job at keeping the quality high. I never found an app that had no value to the phone. + +## Battery + +The iPhones battery is the most impressive part. The Nexus 5 will give me a full day, but will need a charge at the end of the day. The 5c's battery usage is very low. the phone will go all day, and most of the night on one change. The iPhone also charges much faster than the Nexus 5. The one thing that pissed me off, was the Apple charging cable costs $19. I really like Android's use of the universal microUSB. + +## Siri vs Google Now + +I'm not going into to much depth here, but as a user I much prefered Google Now. Although Siri had some nice qualities, I felt like google now was more accurate on searching, and provided better context in my queries. Google Now feels much snappier, and responds only when you need it *(ok google)*. + +## Trend Factor + +I think apple always use to win this category, however with google wallet and NFC payment I have to give this to the Nexus 5. I have baught many things with my phone, and every time people are amazed. When you are at McDonalds and the only thing standing between you and a big Mac is a simple NFC tap, people think you are gods gift to the earth. One woman asked me out on a date after buying something at the pharmacy (I'm not kidding...it really happend). She was in utter amazement about how suave I was with my phone. Apple has really slipped in years, now more than ever people are interested in Android phones. + +## Verdict + + +The iPhone, while being a real contender is far from perfect. I have give this to the Nexus 5. That being the case my dream phone would be an iPhone running Android software. I really prefer the software of Android, but retina display, and camera really makes me like the iPhone a lot. My only serious gripe with Android is the quality of the apps. However it does not override the iPhones terrible keyboard. diff --git a/content/blog/making-a-minimal-webapp-with-dotnet-core.md b/content/blog/making-a-minimal-webapp-with-dotnet-core.md new file mode 100644 index 0000000..b6b9681 --- /dev/null +++ b/content/blog/making-a-minimal-webapp-with-dotnet-core.md @@ -0,0 +1,58 @@ +--- +title: Making a minimal webapp with dotnet core +date: 2017-03-02T01:11:18.000Z +tags: + - csharp + - csharp + - aspnet core + - dotnet core +--- + + +Recently I wanted to make myself a short url host. Really, I made this not to make short urls, but to make memorable urls for myself. + + + +> I wanted to say goto [aka.terribledev.io/docker101](https://aka.terribledev.io/docker101) for my docker101 class + + +This is clearly a very simple webapp. Basically a dictionary of path's to 301's. Probably the simplest WebApplication anyone can make. [So I made it](https://github.com/terribledev/aka.terribledev.io). + +So, I'm sure you are wondering. Well why am I reading this blog? Well, my app does not use mvc, or any web framework. My app uses the mvc core 1.0 router as middleware. This was talked about a while back on an episode of [live.asp.net](https://live.asp.net). + +I first just used the [aspnet yeoman generator](https://www.npmjs.com/package/generator-aspnet), asking for webapi. I then deleted the only controller I was given, and got rid of most of the mvc packages with the exception of `Microsoft.AspNetCore.Routing`. I then just modified my `Startup.cs` file to look like below. + +Essentially I add the routing package to the container, and then have have the app use the router mapping `docker101` to the proper url. Easy right? + + + +```csharp + + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + + services.AddRouting(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + app.UseRouter(a=>{ + foreach(var route in Routes.RoutesDictionary) + { + a.MapGet("docker101", handler: async b=>{ + b.Response.Redirect("https://blog.terrible.dev/Getting-started-with-docker-containers/", true); + }); + } + }); + } + +``` + +Ok, so what is the result? Well, extremely fast url parsing thanks to the mvc router, and a really lightweight application. Since we have no session, or even convention based action resolution. Our app is extremely thin, and fast. + + +So, thank Microsoft for really making the components mvc modular. This provides a very small, and lightweight service! \ No newline at end of file diff --git a/content/blog/secondpost.md b/content/blog/secondpost.md deleted file mode 100644 index 3c521a6..0000000 --- a/content/blog/secondpost.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: This is my second post with a much longer title. -description: This is a post on My Blog about leveraging agile frameworks. -date: 2018-07-04 -tags: - - number 2 ---- -Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. - -## Section Header - -First post -Third post - -Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. - -Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. diff --git a/content/blog/thirdpost.md b/content/blog/thirdpost.md deleted file mode 100644 index bdea878..0000000 --- a/content/blog/thirdpost.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: This is my third post. -description: This is a post on My Blog about win-win survival strategies. -date: 2018-08-24 -tags: - - second tag - - posts with two tags ---- -Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. - -## Code - -### Styled (with Syntax) - -Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. - -```js -// this is a command -function myCommand() { - let counter = 0; - counter++; -} - -// Test with a line break above this line. -console.log('Test'); -``` - -### Unstyled - -Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. - -``` -// this is a command -function myCommand() { - let counter = 0; - counter++; -} - -// Test with a line break above this line. -console.log('Test'); -``` - -## Section Header - -Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. diff --git a/content/blog/use-dotnet-rc2-with-appveyor.md b/content/blog/use-dotnet-rc2-with-appveyor.md new file mode 100644 index 0000000..63c348c --- /dev/null +++ b/content/blog/use-dotnet-rc2-with-appveyor.md @@ -0,0 +1,47 @@ +--- +title: Use dotnet rc2 with appveyor +date: 2016-05-21T23:13:47.000Z +tags: + - appveyor + - dotnet +--- + +dotnet CLI is currently in RC2, and while the train is fast approaching RTM, most tools are still catching up. [dotnet](dot.net) seems to have a documented cli based install for every platform except the good ol windows. That being said getting a windows based install/build is possible. + + +Place the following powershell as the before build step in appveyor. In short, download the installer, run it, and then restore your nuget packages. I got the flags for the installer by running the installer with /? + +```powershell + (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/4/6/1/46116DFF-29F9-4FF8-94BF-F9BE05BE263B/packages/DotNetCore.1.0.0.RC2-SDK.Preview1-x64.exe','core.exe') + + core.exe /install /quiet /norestart + + dotnet restore + + +``` + +if you have solution files, and a project system them appveyor should build the project automatically. If you don't then set the build command to be `dotnet build .\path\to\your\proj` + +Since aspnet core builds to not emit dependent dll's appveyor's auto detect and run for tests doesn't work. Make sure you have added the test runner to your project.json and just run `dotnet test .\path\to\your\tests` as your test_script of your appveyor.yml file + +You can find a working example [here](https://github.com/TerribleDev/shodan.net) + +tl;dr appveyor.yml: + +```yml +version: 1.0.{build} +configuration: Release +before_build: +- ps: >- + (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/4/6/1/46116DFF-29F9-4FF8-94BF-F9BE05BE263B/packages/DotNetCore.1.0.0.RC2-SDK.Preview1-x64.exe','core.exe') + + core.exe /install /quiet /norestart + + dotnet restore +build: + verbosity: minimal +test_script: +- cmd: dotnet test .\path\to\mytests + +``` \ No newline at end of file diff --git a/content/tags.njk b/content/tags.old similarity index 100% rename from content/tags.njk rename to content/tags.old diff --git a/eleventy.config.js b/eleventy.config.js index 3fba4b7..45ff26a 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -111,7 +111,7 @@ module.exports = function(eleventyConfig) { ], // Pre-process *.md files with: (default: `liquid`) - markdownTemplateEngine: "njk", + markdownTemplateEngine: false, // Pre-process *.html files with: (default: `liquid`) htmlTemplateEngine: "njk", diff --git a/package.json b/package.json index e3340f0..e3bdb8a 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "8.0.0", "description": "A starter repository for a blog web site using the Eleventy site generator.", "scripts": { + "prebuild": "rm -rf _site", "build": "npx @11ty/eleventy", "build-ghpages": "npx @11ty/eleventy --pathprefix=/eleventy-base-blog/", "start": "npx @11ty/eleventy --serve --quiet",