Friday, April 5, 2019

Some notes from some coaching on CSS and Sass today.

  1. Another difference between Sass and LESS beyond Sass having supposedly better mixins at a complexity level few ever visit is that LESS will lazy load imported files as it needs them while Sass will grab them all at once upfront. Before the LESS way sounds better to you, consider that it comes with more HTTP calls and could ultimately be "heavier" all around.
  2. Two things connected by a dot as suggested here basically means that both things are required for the effect.
  3. When styling say the table rows of a table in Sass you should likely have a nesting effect, but be wary of having a nesting effect too deep leading to Sass that is too indented to a point of unreadability. Nesting a style inside of a style in Sass will make CSS in which the nested style comes after the outer style suggesting that elements matching that criteria within the greater thing being styled should have that cascaded effect.
  4. Any subeffect (not the technical term) starting out with a colon like :first-child should be nested in Sass like so:
    .startingpoint button {
       padding: 0;
       margin: 0 0 10px 0;
       background-color: $genericbackground;
       border: none;
       font-size: 20px;
       cursor: pointer;
       outline: none;
       &:link {
          font-weight: normal;
          color: $black;
       }
       &:visited {
          font-weight: normal;
          color: $black;
       }
       &:hover {
          font-weight: bold;
          color: $green;
       }
       &:focus {
          font-weight: bold;
          color: $green;
       }
       &:active {
          font-weight: normal;
          color: $black;
       }
    }

Spongebob case

I NeEd hEaLtHcArE bEcAuSe I hAvE caNcEr aNd iM dYinG. is an example. If you look close this is not even alternating uppercase with lowercase, but instead its just a dumb mix of upper and lowercase beholden to no rules other than a desire to be noisy. Talk like this comes from the Mocking Spongebob memes.

Thursday, April 4, 2019

Record a video with Skype!

Click the "Share Content" icon that looks like an arrow pointing Northeasternly from the middle of a monitor and then pick "Share your Desktop..." from the menu that appears. At the icon of three dots in a horizontal row inside a circle there will be options for "Start Recording" and "Stop Recording" and "Manage Recordings" and the last of these should take you to a little list of your recordings. C:\Users\TJaeschk\Videos\Lync Recordings is the folder path to where mine in particular are kept. Yours will be a bit different. Duh.

In Azure DevOps, set the version number at package.json to be your build's version number.

Under "Builds" under "Pipelines" in Azure DevOps, click the "Edit" button at the upper right to see the steps in your build. Herein you may have a PowerShell script to set the version number. It could start like so:

$packageJsonPath = 'src/Trifecta/package.json'
function Format-Json([Parameter(Mandatory, ValueFromPipeline)][String] $json) {
   $indent = 0;
   ($json -Split '\n' |
      % {
         if ($_ -match '[\}\]]') {
            $indent--
         }
         $line = (' ' * $indent * 4) + $_.TrimStart().Replace(': ', ': ')
         if ($_ -match '[\{\[]') {
            $indent++
         }
         $line
   }) -Join "`n"
}
$package = ((Get-Content $packageJsonPath) -join "`n" | ConvertFrom-Json)

 
 

...and end like so:

$path = Resolve-Path $packageJsonPath
$content = ConvertTo-Json $package | Format-Json
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines($path, $content, $Utf8NoBomEncoding)

 
 

...and have this in-between to set a property on package.json:

$package.version = $env:version

 
 

Note that the first blob of code above shows off how to make and call a function in PowerShell. Another thing I learned in this process is that to have a comment in PowerShell you lead a line with a pound sign/hash tag/number symbol. The code here is one of the few examples where I am shamelessly stealing from others. I am loathe to rename variable names and like in the name of a dress-up as I fear breaking something.

terminology from a set of presentations at work today

  1. There is a Linux-based security bundle of tools called the Security Onion.
  2. Zeek, originally named Bro, offers network analysis, while netsniff-ng specifically analyzes Linux networks for shortcomings.
  3. DNS Exfiltration is the art of making sinister DNS requests.
  4. Suricata is an intrusion detection system or IDS. It's logo has a meerkat standing up on its hindlegs to have a looksee. I think it is also an IPS (intrusion prevention system) offering controls and not just monitoring.
  5. The big four Vs or big data are volume (how much?), velocity (how do we stream stuff in?), variety (what are your sources?), and veracity (dealing with uncertainty and the complexity of sanity checks).
  6. Cloudera Data Science Workbench is a tool for data science.
  7. ODBC is Open Database Connectivity and is not JDBC or Java Database Connectivity.

Wednesday, April 3, 2019

use .includes in TypeScript

See if a match is in a collection!

private getBusinessUnitRecordsSuccess(records:Array){
   records.forEach(r => {
      if (this.user.BusinessUnitIds.includes(r.BusinessUnitID)){
         this.businessUnitRecords.push(r);
      }
   });
}

named ranges in Microsoft Excel

Draw a selection around a set of cells, right-click on it, and pick "Define Name..." from the menu that appears to make a named range. Alternatively, at the "Insert" ribbon pick "Table" with a selection selected and then type a name for the table at the upper left in the ribbon. The tables and the named ranges will hopefully provide a better way to grab ahold of Excel data when parsing Excel sheets in code. This will hopefully be more reliable and less brittle than grabbing cells by column and row number.